-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
I am running the example shown in https://dspy-docs.vercel.app/docs/building-blocks/modules for ChainOfThought. Instead of getting 5 answers, I got only one answer.
Moreover, when running on a jupyter notebook. Rerunning the same cell produces the same outcome. I need to restart the kernel to get a different response.
lm = dspy.OpenAI(
api_base="http://localhost:11434/v1/",
api_key="ollama",
model="mistral",
stop="\n\n",
model_type="chat",
)
dspy.settings.configure(lm=lm, temperature=0.7)
question = "What's something great about the ColBERT retrieval model?"
#1) Declare with a signature, and pass some config.
classify = dspy.cChainOfThought("question -> answer", n=5)
#2) Call with input argument.
response = classify(question=question)
#3) Access the outputs.
response.completions.answer # len(response.completions.answer) -> 1 expected 5
Output:
['The ColBERT retrieval model is great because it combines the power of BERT, a pre-trained language model, with information retrieval techniques. This allows it to understand the context and meaning behind queries, and retrieve relevant documents more effectively compared to traditional retrieval models.']