ddosxd commited on
Commit
26587a6
·
1 Parent(s): f58f61e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -7
main.py CHANGED
@@ -108,13 +108,7 @@ def v_chat_completions():
108
 
109
  auth = request.headers.get('User-Agent', 'Bearer anonim')
110
  if auth != f'Bearer {settings["security"]["passw"]}':
111
- if streaming:
112
- er = 'Not authorized'
113
- def errorStream(er):
114
- yield 'data: %s\n\n' % json.dumps({"status":"!=200","error":str(er)}, separators=(',' ':'))
115
- return app.response_class(errorStream(er), mimetype='text/event-stream')
116
- else:
117
- return json.dumps({'error':'Not authorized'})
118
 
119
 
120
  model = request.json.get('model', 'gpt-3.5-turbo')
 
108
 
109
  auth = request.headers.get('User-Agent', 'Bearer anonim')
110
  if auth != f'Bearer {settings["security"]["passw"]}':
111
+ return json.dumps({'error':'Not authorized'})
 
 
 
 
 
 
112
 
113
 
114
  model = request.json.get('model', 'gpt-3.5-turbo')