dfa32412 commited on
Commit
6268608
·
verified ·
1 Parent(s): 42f4898

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -388,10 +388,13 @@ async def stream_openai_response(response, request_id: str, model: str, token: s
388
  logger.warning(f"无法解析响应: {line}")
389
 
390
  # 更新token状态(成功)
391
- update_token_status(token, True)
 
392
 
393
  except Exception as e:
394
  logger.error(f"流式响应处理出错: {str(e)}")
 
 
395
  # 更新token状态(失败)
396
  update_token_status(token, False, str(e))
397
 
 
388
  logger.warning(f"无法解析响应: {line}")
389
 
390
  # 更新token状态(成功)
391
+ if not codeFlag:
392
+ update_token_status(token, True)
393
 
394
  except Exception as e:
395
  logger.error(f"流式响应处理出错: {str(e)}")
396
+ if '今日额度已用完啦' in str(e):
397
+ TOKEN_INDEX = (TOKEN_INDEX + 1) % len(DEEPSIDER_TOKEN)
398
  # 更新token状态(失败)
399
  update_token_status(token, False, str(e))
400