Skip to content

Commit 25d6753

Browse files
committed
added default ollama ctx size & config entry
1 parent 0495d02 commit 25d6753

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Writer/Config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
CHECKER_MODEL = "ollama://llama3:70b" # Model used to check results
1919
TRANSLATOR_MODEL = "ollama://llama3:70b"
2020

21+
OLLAMA_CTX = 8192
22+
2123
OLLAMA_HOST = "127.0.0.1:11434"
2224

2325
SEED = 12 # Note this value is overridden by the argparser

Writer/Interface/Wrapper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ def ChatAndStreamResponse(
246246
if key not in ValidParameters:
247247
raise ValueError(f"Invalid parameter: {key}")
248248

249+
# Set the default num_ctx if not set by args
250+
if "num_ctx" not in ModelOptions:
251+
ModelOptions["num_ctx"] = Writer.Config.OLLAMA_CTX
252+
249253
_Logger.Log(f"Using Ollama Model Options: {ModelOptions}", 4)
250254

251255
if _Format == "json":

0 commit comments

Comments
 (0)