yym68686 commited on
Commit
1d0ce62
·
1 Parent(s): c2775d8

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. utils.py +1 -1
utils.py CHANGED
@@ -56,7 +56,7 @@ async def error_handling_wrapper(generator, status_code=200):
56
  return new_generator()
57
  except StopAsyncIteration:
58
  # 处理生成器为空的情况
59
- return []
60
 
61
  def post_all_models(token):
62
  all_models = []
 
56
  return new_generator()
57
  except StopAsyncIteration:
58
  # 处理生成器为空的情况
59
+ return "data: {'error': 'No data returned'}\n\n"
60
 
61
  def post_all_models(token):
62
  all_models = []