Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Fix attribute error when checking for azure model warning (#611)

Kilian Lieret36ca5d8b8750
diff --git a/sweagent/agent/models.py b/sweagent/agent/models.py
index ef5ba9bd..ae00a141 100644
--- a/sweagent/agent/models.py
+++ b/sweagent/agent/models.py
@@ -244,12 +244,11 @@ class OpenAIModel(BaseModel):
# Set OpenAI key
if self.args.model_name.startswith("azure"):
- if "model" in self.args and self.args.model:
- logger.warning(
- "The --model CLI argument is ignored when using the Azure GPT endpoint. "
- "The model is determined by the AZURE_OPENAI_DEPLOYMENT key/"
- "environment variable (this might change in the future).",
- )
+ logger.warning(
+ "The --model CLI argument is ignored when using the Azure GPT endpoint. "
+ "The model is determined by the AZURE_OPENAI_DEPLOYMENT key/"
+ "environment variable (this might change in the future).",
+ )
self.api_model = keys_config["AZURE_OPENAI_DEPLOYMENT"]
self.client = AzureOpenAI(
api_key=keys_config["AZURE_OPENAI_API_KEY"],