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]

Remove azure override of model name (#127)

Kilian Lieret311467c9620a
diff --git a/README.md b/README.md
index e2d944b3..ae2c0cb0 100644
--- a/README.md
+++ b/README.md
@@ -119,7 +119,6 @@ ANTHROPIC_API_KEY: 'Anthropic API Key Here if using Anthropic Model (optional)'
TOGETHER_API_KEY: 'Together API Key Here if using Together Model (optional)'
AZURE_OPENAI_API_KEY: 'Azure OpenAI API Key Here if using Azure OpenAI Model (optional)'
AZURE_OPENAI_ENDPOINT: 'Azure OpenAI Endpoint Here if using Azure OpenAI Model (optional)'
-AZURE_OPENAI_DEPLOYMENT: 'Azure OpenAI Deployment Here if using Azure OpenAI Model (optional)'
AZURE_OPENAI_API_VERSION: 'Azure OpenAI API Version Here if using Azure OpenAI Model (optional)'
OPENAI_API_BASE_URL: 'LLM base URL here if using Local or alternative api Endpoint (optional)'
```
diff --git a/sweagent/agent/models.py b/sweagent/agent/models.py
index b4edf516..283ca8fe 100644
--- a/sweagent/agent/models.py
+++ b/sweagent/agent/models.py
@@ -224,7 +224,6 @@ class OpenAIModel(BaseModel):
# Set OpenAI key
cfg = config.Config(os.path.join(os.getcwd(), "keys.cfg"))
if self.args.model_name.startswith("azure"):
- self.api_model = cfg["AZURE_OPENAI_DEPLOYMENT"]
self.client = AzureOpenAI(api_key=cfg["AZURE_OPENAI_API_KEY"], azure_endpoint=cfg["AZURE_OPENAI_ENDPOINT"], api_version=cfg.get("AZURE_OPENAI_API_VERSION", "2024-02-01"))
else:
api_base_url: Optional[str] = cfg.get("OPENAI_API_BASE_URL", None)