Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/llama.cpp/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 665 B image not shown  

Quelle  detect-chat-template.patch  Sprache: unbekannt

 
Spracherkennung für: .patch vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

diff --git a/src/llama-chat.cpp b/src/llama-chat.cpp
index 61ceb1e41d..e96699e58a 100644
--- a/src/llama-chat.cpp
+++ b/src/llama-chat.cpp
@@ -74,11 +74,17 @@
 }
 
 llm_chat_template llm_chat_detect_template(const std::string & tmpl) {
+#if 0
     try {
         return llm_chat_template_from_str(tmpl);
     } catch (const std::out_of_range &) {
         // ignore
     }
+#endif
+    auto chat_template = LLM_CHAT_TEMPLATES.find(tmpl);
+    if (chat_template != LLM_CHAT_TEMPLATES.end()) {
+        return chat_template->second;
+    }
 
     auto tmpl_contains = [&tmpl](const char * haystack) -> bool {
         return tmpl.find(haystack) != std::string::npos;

[Dauer der Verarbeitung: 0.15 Sekunden, vorverarbeitet 2026-09-27]