Uvicorn as an ASGI server, disable WebSocket support on startup
Browse files
main.py
CHANGED
@@ -152,7 +152,6 @@ class ModelRequestHandler:
|
|
152 |
except (Exception, HTTPException) as e:
|
153 |
print('\033[31m')
|
154 |
print(f"Error with provider {provider['provider']}: {str(e)}")
|
155 |
-
# traceback.print_exc()
|
156 |
print('\033[0m')
|
157 |
if auto_retry:
|
158 |
continue
|
@@ -205,4 +204,10 @@ def generate_api_key():
|
|
205 |
|
206 |
if __name__ == '__main__':
|
207 |
import uvicorn
|
208 |
-
uvicorn.run(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
except (Exception, HTTPException) as e:
|
153 |
print('\033[31m')
|
154 |
print(f"Error with provider {provider['provider']}: {str(e)}")
|
|
|
155 |
print('\033[0m')
|
156 |
if auto_retry:
|
157 |
continue
|
|
|
204 |
|
205 |
if __name__ == '__main__':
|
206 |
import uvicorn
|
207 |
+
uvicorn.run(
|
208 |
+
"__main__:app",
|
209 |
+
host="0.0.0.0",
|
210 |
+
port=8000,
|
211 |
+
reload=True,
|
212 |
+
ws="none"
|
213 |
+
)
|