yym68686 commited on
Commit
29e15d9
·
1 Parent(s): 339bb82

Fixing bug: Error handling response

Browse files
Files changed (1) hide show
  1. utils.py +2 -3
utils.py CHANGED
@@ -1,6 +1,5 @@
1
  import json
2
- from fastapi import HTTPException, Depends
3
- from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
4
 
5
  from log_config import logger
6
 
@@ -89,7 +88,7 @@ async def error_handling_wrapper(generator, status_code=200):
89
  first_item_str = first_item_str[6:]
90
  elif first_item_str.startswith("data:"):
91
  first_item_str = first_item_str[5:]
92
- if first_item_str == "[DONE]":
93
  logger.error("error_handling_wrapper [DONE]!")
94
  raise StopAsyncIteration
95
  try:
 
1
  import json
2
+ from fastapi import HTTPException
 
3
 
4
  from log_config import logger
5
 
 
88
  first_item_str = first_item_str[6:]
89
  elif first_item_str.startswith("data:"):
90
  first_item_str = first_item_str[5:]
91
+ if first_item_str.startswith("[DONE]"):
92
  logger.error("error_handling_wrapper [DONE]!")
93
  raise StopAsyncIteration
94
  try: