yym68686 commited on
Commit
1e617f9
·
1 Parent(s): e6f7928

Fix a possible bug that occurs when attempting to encode a dictionary (dict) object as a string in a FastAPI application.

Browse files
Files changed (1) hide show
  1. main.py +7 -7
main.py CHANGED
@@ -165,13 +165,13 @@ model_handler = ModelRequestHandler()
165
 
166
  @app.post("/v1/chat/completions")
167
  async def request_model(request: RequestModel, token: str = Depends(verify_api_key)):
168
- try:
169
- return await model_handler.request_model(request, token)
170
- except Exception as e:
171
- print('\033[31m')
172
- print(f"request_model Error: {str(e)}")
173
- traceback.print_exc()
174
- print('\033[0m')
175
 
176
  @app.options("/v1/chat/completions")
177
  async def options_handler():
 
165
 
166
  @app.post("/v1/chat/completions")
167
  async def request_model(request: RequestModel, token: str = Depends(verify_api_key)):
168
+ # try:
169
+ return await model_handler.request_model(request, token)
170
+ # except Exception as e:
171
+ # print('\033[31m')
172
+ # print(f"request_model Error: {str(e)}")
173
+ # traceback.print_exc()
174
+ # print('\033[0m')
175
 
176
  @app.options("/v1/chat/completions")
177
  async def options_handler():