fcu52005505 commited on
Commit
156b4a5
·
verified ·
1 Parent(s): 5d5ce3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 = 60 # 1 分钟 = 60 秒
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. This Space pings itself every 60s to avoid sleeping.",
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"]