fix
This commit is contained in:
@@ -16,6 +16,14 @@ OLLAMA_URL = "http://localhost:11434"
|
||||
MODEL = "qwen3:14b"
|
||||
DIR = Path(__file__).resolve().parent
|
||||
|
||||
# Параметры для стабильного структурированного вывода (JSON framework)
|
||||
OLLAMA_OPTIONS = {
|
||||
"temperature": 0.3, # ниже = детерминированнее, меньше «творчества» и смены языка
|
||||
"num_ctx": 8500, # контекст под длинную главу
|
||||
"num_predict": 4096, # лимит токенов ответа под полный frame
|
||||
"repeat_penalty": 1.1,
|
||||
}
|
||||
|
||||
|
||||
def load_input() -> dict:
|
||||
with open(DIR / "вход_главы.json", encoding="utf-8") as f:
|
||||
@@ -49,6 +57,7 @@ def call_ollama(prompt: str) -> str:
|
||||
"messages": [{"role": "user", "content": prompt}],
|
||||
"stream": False,
|
||||
"format": "json",
|
||||
"options": OLLAMA_OPTIONS,
|
||||
},
|
||||
ensure_ascii=False,
|
||||
).encode("utf-8")
|
||||
|
||||
Reference in New Issue
Block a user