Moonfanz commited on
Commit
1021a7f
·
verified ·
1 Parent(s): e2b482a

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
app.py CHANGED
@@ -232,9 +232,7 @@ GEMINI_MODELS = [
232
  {"id": "gemini-2.0-flash-exp"},
233
  {"id": "gemini-2.0-flash-thinking-exp-1219"},
234
  {"id": "gemini-2.0-flash-thinking-exp-01-21"},
235
- {"id": "gemini-2.0-exp"},
236
- {"id": "gemini-2.0-pro-exp"},
237
- {"id": "gemini-2.0-pro-exp-01-28"}
238
  ]
239
 
240
  @app.route('/')
@@ -688,18 +686,18 @@ def embeddings():
688
  print(f"请求Embeddings失败↙\: {e}")
689
  return jsonify({"error": str(e)}), 500
690
 
691
- def keep_alive():
692
- try:
693
- response = requests.get("http://127.0.0.1:7860/", timeout=10)
694
- response.raise_for_status()
695
- print(f"Keep alive ping successful: {response.status_code} at {time.ctime()}")
696
- except requests.exceptions.RequestException as e:
697
- print(f"Keep alive ping failed: {e} at {time.ctime()}")
698
 
699
  if __name__ == '__main__':
700
  scheduler = BackgroundScheduler()
701
 
702
- scheduler.add_job(keep_alive, 'interval', hours=12)
703
  scheduler.start()
704
  logger.info(f"Reminiproxy v2.3.5 启动")
705
  logger.info(f"最大尝试次数/MaxRetries: {MAX_RETRIES}")
 
232
  {"id": "gemini-2.0-flash-exp"},
233
  {"id": "gemini-2.0-flash-thinking-exp-1219"},
234
  {"id": "gemini-2.0-flash-thinking-exp-01-21"},
235
+ {"id": "gemini-2.0-pro-exp"}
 
 
236
  ]
237
 
238
  @app.route('/')
 
686
  print(f"请求Embeddings失败↙\: {e}")
687
  return jsonify({"error": str(e)}), 500
688
 
689
+ # def keep_alive():
690
+ # try:
691
+ # response = requests.get("http://127.0.0.1:7860/", timeout=10)
692
+ # response.raise_for_status()
693
+ # print(f"Keep alive ping successful: {response.status_code} at {time.ctime()}")
694
+ # except requests.exceptions.RequestException as e:
695
+ # print(f"Keep alive ping failed: {e} at {time.ctime()}")
696
 
697
  if __name__ == '__main__':
698
  scheduler = BackgroundScheduler()
699
 
700
+ # scheduler.add_job(keep_alive, 'interval', hours=12)
701
  scheduler.start()
702
  logger.info(f"Reminiproxy v2.3.5 启动")
703
  logger.info(f"最大尝试次数/MaxRetries: {MAX_RETRIES}")