Spaces:
Paused
Paused
Upload app.py
Browse files
app.py
CHANGED
|
@@ -686,22 +686,13 @@ def embeddings():
|
|
| 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}")
|
| 704 |
logger.info(f"最大请求次数/MaxRequests: {MAX_REQUESTS}")
|
| 705 |
logger.info(f"请求限额窗口/LimitWindow: {LIMIT_WINDOW} 秒")
|
| 706 |
|
| 707 |
-
app.run(debug=True)
|
|
|
|
| 686 |
print(f"请求Embeddings失败↙\: {e}")
|
| 687 |
return jsonify({"error": str(e)}), 500
|
| 688 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 689 |
if __name__ == '__main__':
|
| 690 |
scheduler = BackgroundScheduler()
|
| 691 |
|
|
|
|
| 692 |
scheduler.start()
|
| 693 |
logger.info(f"Reminiproxy v2.3.5 启动")
|
| 694 |
logger.info(f"最大尝试次数/MaxRetries: {MAX_RETRIES}")
|
| 695 |
logger.info(f"最大请求次数/MaxRequests: {MAX_REQUESTS}")
|
| 696 |
logger.info(f"请求限额窗口/LimitWindow: {LIMIT_WINDOW} 秒")
|
| 697 |
|
| 698 |
+
app.run(debug=True, host='0.0.0.0', port=7860)
|