Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

BootstrapFewShot failing due to lm.copy for AzureOpenAI, #521

Insop Song5cdd7eb2478a
diff --git a/dsp/modules/azure_openai.py b/dsp/modules/azure_openai.py
index d930bec6b..c90f634e4 100644
--- a/dsp/modules/azure_openai.py
+++ b/dsp/modules/azure_openai.py
@@ -107,6 +107,9 @@ class AzureOpenAI(LM):
kwargs["model"] = model
self.kwargs = {
+ "api_base": api_base,
+ "api_version": api_version,
+ "api_key": api_key,
"temperature": 0.0,
"max_tokens": 150,
"top_p": 1,
diff --git a/dsp/modules/lm.py b/dsp/modules/lm.py
index e2965d49a..5d3866079 100644
--- a/dsp/modules/lm.py
+++ b/dsp/modules/lm.py
@@ -101,4 +101,4 @@ class LM(ABC):
kwargs = {**self.kwargs, **kwargs}
model = kwargs.pop('model')
- return self.__class__(model, **kwargs)
+ return self.__class__(model=model, **kwargs)