rasAli02 commited on
Commit
b3da97f
·
1 Parent(s): 559bf9e

fix: ensure AMD_INFERENCE_URL has http protocol prefix

Browse files
Files changed (2) hide show
  1. agents.py +2 -0
  2. app.py +4 -1
agents.py CHANGED
@@ -187,6 +187,8 @@ async def _call_amd_vllm(
187
 
188
  # Candidate endpoints
189
  base_url = AMD_INFERENCE_URL.rstrip("/")
 
 
190
  candidates = [
191
  f"{base_url}/proxy/8000/v1/chat/completions",
192
  f"{base_url}/proxy/8001/v1/chat/completions",
 
187
 
188
  # Candidate endpoints
189
  base_url = AMD_INFERENCE_URL.rstrip("/")
190
+ if not base_url.startswith("http"):
191
+ base_url = f"http://{base_url}"
192
  candidates = [
193
  f"{base_url}/proxy/8000/v1/chat/completions",
194
  f"{base_url}/proxy/8001/v1/chat/completions",
app.py CHANGED
@@ -217,7 +217,10 @@ async def api_get_telemetry():
217
  error_msg = None
218
 
219
  # Try current proxy endpoint
220
- url = f"{AMD_INFERENCE_URL.rstrip('/')}/v1/models"
 
 
 
221
  headers = {}
222
  if AMD_INFERENCE_TOKEN:
223
  headers["Authorization"] = f"Bearer {AMD_INFERENCE_TOKEN}"
 
217
  error_msg = None
218
 
219
  # Try current proxy endpoint
220
+ base_url = AMD_INFERENCE_URL.rstrip('/')
221
+ if not base_url.startswith("http"):
222
+ base_url = f"http://{base_url}"
223
+ url = f"{base_url}/v1/models"
224
  headers = {}
225
  if AMD_INFERENCE_TOKEN:
226
  headers["Authorization"] = f"Bearer {AMD_INFERENCE_TOKEN}"