Spaces:
Sleeping
Sleeping
Update main.py
Browse files
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 |
-
|
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')
|