Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

Update lm.py

Andrés Wagner866840d42d24
diff --git a/dsp/modules/lm.py b/dsp/modules/lm.py
index cfe8b88d0..6cc07efc6 100644
--- a/dsp/modules/lm.py
+++ b/dsp/modules/lm.py
@@ -55,6 +55,8 @@ class LM(ABC):
printed.append((prompt, x["response"].text))
elif provider == "mistral":
printed.append((prompt, x['response'].choices))
+ elif provider == "ibm":
+ printed.append((prompt, x))
else:
printed.append((prompt, x["response"]["choices"]))
@@ -84,6 +86,8 @@ class LM(ABC):
text = choices[0].parts[0].text
elif provider == "mistral":
text = choices[0].message.content
+ elif provider == "ibm":
+ text = choices
else:
text = choices[0]["text"]
printing_value += self.print_green(text, end="")