liuyizhang commited on
Commit
4099f3a
1 Parent(s): 54ed26e

update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -448,7 +448,8 @@ def get_response_from_openai(input, prompt_system, chat_history, model_radio, te
448
  ret = re.sub(r"<pre style='background-color: #ddd;margin-left:20px;padding-left:10px;'>(.*?)</pre>", lambda m: "<pre style='background-color: #ddd; color:#000; margin-left:20px;padding-left:10px;'>" + m.group(1).replace('<br>', '\n') + '</pre>', ret)
449
  # logger.info(f'ret_2_={ret}')
450
  if ret == '':
451
- ret = f"Openai said: I'm too tired."
 
452
  return ret, response.usage
453
  except Exception as e:
454
  logger.info(f"openai_create_error__{e}")
 
448
  ret = re.sub(r"<pre style='background-color: #ddd;margin-left:20px;padding-left:10px;'>(.*?)</pre>", lambda m: "<pre style='background-color: #ddd; color:#000; margin-left:20px;padding-left:10px;'>" + m.group(1).replace('<br>', '\n') + '</pre>', ret)
449
  # logger.info(f'ret_2_={ret}')
450
  if ret == '':
451
+ ret = f"Openai said: I'm too tired."
452
+ logger.info(f'openai.api_key = {openai.api_key}')
453
  return ret, response.usage
454
  except Exception as e:
455
  logger.info(f"openai_create_error__{e}")