yashxx07 commited on
Commit
af49d90
·
verified ·
1 Parent(s): f8eba03

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -102,7 +102,7 @@ async def root(item: Item):
102
  return {'summary': ""}
103
 
104
 
105
- url = 'https://yashxx07-hf-llm-api.hf.space/api/v1/chat/completions'
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}