Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Update the code to use ollama, mute verbose print

Insop Songbec5f089c21c
diff --git a/dsp/modules/ollama.py b/dsp/modules/ollama.py
index 7e35d0b61..4ed551fdd 100644
--- a/dsp/modules/ollama.py
+++ b/dsp/modules/ollama.py
@@ -106,7 +106,7 @@ class OllamaLocal(LM):
tot_eval_tokens += response_json.get("eval_count")
request_info["additional_kwargs"] = {k: v for k, v in response_json.items() if k not in ["response"]}
- print('RESPONSE JSON', response_json)
+ # print('RESPONSE JSON', response_json)
request_info["usage"] = {
"prompt_tokens": response_json.get("prompt_eval_count"),
"completion_tokens": tot_eval_tokens,
diff --git a/dspy/__init__.py b/dspy/__init__.py
index 71aba8b1a..5a6c165ee 100644
--- a/dspy/__init__.py
+++ b/dspy/__init__.py
@@ -24,6 +24,7 @@ HFClientVLLM = HFClientVLLM
Anyscale = dsp.Anyscale
HFModel = dsp.HFModel
+OllamaLocal = dsp.OllamaLocal
configure = settings.configure
context = settings.context
\ No newline at end of file