Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

Move `stop_sequences` to init kwargs rather than passed into `basic_request` as kwargs there.

Connor Shortenf8097dfb0bb9
diff --git a/dsp/modules/cohere.py b/dsp/modules/cohere.py
index e88c6d5c7..a967238a6 100644
--- a/dsp/modules/cohere.py
+++ b/dsp/modules/cohere.py
@@ -67,9 +67,9 @@ class Cohere(LM):
"frequency_penalty": 0,
"presence_penalty": 0,
"num_generations": 1,
+ "stop_sequences": stop_sequences
**kwargs,
}
- self.stop_sequences = stop_sequences
self.max_num_generations = 5
self.history: list[dict[str, Any]] = []
@@ -78,7 +78,6 @@ class Cohere(LM):
raw_kwargs = kwargs
kwargs = {
**self.kwargs,
- "stop_sequences": self.stop_sequences,
"prompt": prompt,
**kwargs,
}