Spaces:
Sleeping
Sleeping
update
Browse files- llm/deepinfra_api.py +2 -2
- llm/vllm_api.py +1 -1
llm/deepinfra_api.py
CHANGED
@@ -25,7 +25,7 @@ class DeepInfraApi(LlmApi):
|
|
25 |
"""
|
26 |
try:
|
27 |
async with httpx.AsyncClient() as client:
|
28 |
-
response = await client.get(f"{self.params.url}/v1/openai/models", super().create_headers())
|
29 |
if response.status_code == 200:
|
30 |
json_data = response.json()
|
31 |
return [item['id'] for item in json_data.get('data', [])]
|
@@ -148,6 +148,6 @@ class DeepInfraApi(LlmApi):
|
|
148 |
request = await self.create_request(prompt)
|
149 |
|
150 |
async with httpx.AsyncClient() as client:
|
151 |
-
response = client.post(f"{self.params.url}/v1/openai/chat/completions", super().create_headers(), json=request)
|
152 |
if response.status_code == 200:
|
153 |
return response.json()["choices"][0]["message"]["content"]
|
|
|
25 |
"""
|
26 |
try:
|
27 |
async with httpx.AsyncClient() as client:
|
28 |
+
response = await client.get(f"{self.params.url}/v1/openai/models", headers=super().create_headers())
|
29 |
if response.status_code == 200:
|
30 |
json_data = response.json()
|
31 |
return [item['id'] for item in json_data.get('data', [])]
|
|
|
148 |
request = await self.create_request(prompt)
|
149 |
|
150 |
async with httpx.AsyncClient() as client:
|
151 |
+
response = client.post(f"{self.params.url}/v1/openai/chat/completions", headers=super().create_headers(), json=request)
|
152 |
if response.status_code == 200:
|
153 |
return response.json()["choices"][0]["message"]["content"]
|
llm/vllm_api.py
CHANGED
@@ -27,7 +27,7 @@ class LlmApi(LlmApi):
|
|
27 |
"""
|
28 |
try:
|
29 |
async with httpx.AsyncClient() as client:
|
30 |
-
response = await client.get(f"{self.params.url}/v1/models", super().create_headers())
|
31 |
if response.status_code == 200:
|
32 |
json_data = response.json()
|
33 |
return [item['id'] for item in json_data.get('data', [])]
|
|
|
27 |
"""
|
28 |
try:
|
29 |
async with httpx.AsyncClient() as client:
|
30 |
+
response = await client.get(f"{self.params.url}/v1/models", headers=super().create_headers())
|
31 |
if response.status_code == 200:
|
32 |
json_data = response.json()
|
33 |
return [item['id'] for item in json_data.get('data', [])]
|