Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

Patch for `num_generations` in `Predict`

Connor Shortena3da06b3ece3
diff --git a/dsp/modules/cohere.py b/dsp/modules/cohere.py
index 5f0d7260e..b3a1369f9 100644
--- a/dsp/modules/cohere.py
+++ b/dsp/modules/cohere.py
@@ -62,6 +62,7 @@ class Cohere(LM):
"temperature": 0.0,
"max_tokens": 150,
"p": 1,
+ "num_generations": 1,
**kwargs,
}
self.stop_sequences = stop_sequences
@@ -78,6 +79,7 @@ class Cohere(LM):
"message": prompt,
**kwargs,
}
+ kwargs.pop("num_generations")
response = self.co.chat(**kwargs)