Spaces:
Runtime error
Runtime error
Commit
·
94c7e5b
1
Parent(s):
31d57ff
changed to uvicorn setup for HF v14
Browse files- main/api.py +2 -6
main/api.py
CHANGED
@@ -51,8 +51,6 @@ class InferenceApi(LitAPI):
|
|
51 |
stream: bool = False
|
52 |
) -> Any:
|
53 |
"""Make an authenticated request to the LLM Server."""
|
54 |
-
access_token = os.environ.get("InfAPITokenWrite")
|
55 |
-
headers = {"Authorization": f"Bearer {access_token}"} if access_token else {}
|
56 |
base_url = self.llm_config.get('base_url', 'http://localhost:8002')
|
57 |
full_endpoint = f"{base_url.rstrip('/')}/{self._get_endpoint(endpoint).lstrip('/')}"
|
58 |
|
@@ -64,16 +62,14 @@ class InferenceApi(LitAPI):
|
|
64 |
method,
|
65 |
self._get_endpoint(endpoint),
|
66 |
params=params,
|
67 |
-
json=json
|
68 |
-
headers=headers
|
69 |
)
|
70 |
else:
|
71 |
response = await client.request(
|
72 |
method,
|
73 |
self._get_endpoint(endpoint),
|
74 |
params=params,
|
75 |
-
json=json
|
76 |
-
headers=headers
|
77 |
)
|
78 |
response.raise_for_status()
|
79 |
return response
|
|
|
51 |
stream: bool = False
|
52 |
) -> Any:
|
53 |
"""Make an authenticated request to the LLM Server."""
|
|
|
|
|
54 |
base_url = self.llm_config.get('base_url', 'http://localhost:8002')
|
55 |
full_endpoint = f"{base_url.rstrip('/')}/{self._get_endpoint(endpoint).lstrip('/')}"
|
56 |
|
|
|
62 |
method,
|
63 |
self._get_endpoint(endpoint),
|
64 |
params=params,
|
65 |
+
json=json
|
|
|
66 |
)
|
67 |
else:
|
68 |
response = await client.request(
|
69 |
method,
|
70 |
self._get_endpoint(endpoint),
|
71 |
params=params,
|
72 |
+
json=json
|
|
|
73 |
)
|
74 |
response.raise_for_status()
|
75 |
return response
|