Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -102,7 +102,7 @@ async def root(item: Item):
|
|
102 |
return {'summary': ""}
|
103 |
|
104 |
|
105 |
-
|
106 |
|
107 |
headers = { "content-type": "application/json" }
|
108 |
data = {
|
@@ -136,7 +136,7 @@ async def root(item: Item):
|
|
136 |
pass
|
137 |
|
138 |
# Use StreamingResponse to stream the events
|
139 |
-
return StreamingResponse(get_stream(), media_type='text/event-stream')
|
140 |
|
141 |
except requests.RequestException as e:
|
142 |
return {"error": str(e), "status_code": 500}
|
|
|
102 |
return {'summary': ""}
|
103 |
|
104 |
|
105 |
+
api_url = 'https://yashxx07-hf-llm-api.hf.space/api/v1/chat/completions'
|
106 |
|
107 |
headers = { "content-type": "application/json" }
|
108 |
data = {
|
|
|
136 |
pass
|
137 |
|
138 |
# Use StreamingResponse to stream the events
|
139 |
+
return StreamingResponse(get_stream(api_url), media_type='text/event-stream')
|
140 |
|
141 |
except requests.RequestException as e:
|
142 |
return {"error": str(e), "status_code": 500}
|