Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from OCR_test import process_image
|
|
| 8 |
def keep_alive_worker():
|
| 9 |
# 替换为你的 HF Space 实际访问 URL(注意格式!)
|
| 10 |
space_url = "https://fcu52005505--test.hf.space"
|
| 11 |
-
interval_sec =
|
| 12 |
|
| 13 |
print(f"[Keep-Alive] Starting background pinger. Pinging {space_url} every {interval_sec} seconds...")
|
| 14 |
|
|
@@ -43,7 +43,7 @@ interface = gr.Interface(
|
|
| 43 |
inputs=gr.Image(type="filepath", label="Upload Image"),
|
| 44 |
outputs=gr.Textbox(label="Detection Results"),
|
| 45 |
title="OCR Detection (Auto-Keep-Alive Enabled)",
|
| 46 |
-
description="Upload an image to get OCR results.
|
| 47 |
examples=[
|
| 48 |
# 可选:添加示例图片路径(若你有放在 Space repo 的 example_images/)
|
| 49 |
# ["example_images/sample1.jpg"]
|
|
|
|
| 8 |
def keep_alive_worker():
|
| 9 |
# 替换为你的 HF Space 实际访问 URL(注意格式!)
|
| 10 |
space_url = "https://fcu52005505--test.hf.space"
|
| 11 |
+
interval_sec = 86400 # 1 分钟 = 60 秒
|
| 12 |
|
| 13 |
print(f"[Keep-Alive] Starting background pinger. Pinging {space_url} every {interval_sec} seconds...")
|
| 14 |
|
|
|
|
| 43 |
inputs=gr.Image(type="filepath", label="Upload Image"),
|
| 44 |
outputs=gr.Textbox(label="Detection Results"),
|
| 45 |
title="OCR Detection (Auto-Keep-Alive Enabled)",
|
| 46 |
+
description="Upload an image to get OCR results.",
|
| 47 |
examples=[
|
| 48 |
# 可选:添加示例图片路径(若你有放在 Space repo 的 example_images/)
|
| 49 |
# ["example_images/sample1.jpg"]
|