Carina1025 commited on
Commit
7bcb1e8
·
verified ·
1 Parent(s): 2b42ef6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -21,7 +21,7 @@ def check_transcript(transcript, threshold=10):
21
  # 提取結束時間部分
22
  time_str = line.split(" - ")[1].strip()
23
  # 將時間戳轉換為秒數
24
- h, m, s = map(float, time_str.split(":"))
25
  total_seconds = h * 3600 + m * 60 + s
26
  end_times.append(total_seconds)
27
 
@@ -42,7 +42,7 @@ iface = gr.Interface(
42
  fn=check_transcript,
43
  inputs=[
44
  gr.Textbox(lines=10, label="逐字稿文本"),
45
- gr.Number(default=10, label="時間間隔閾值(秒數)")
46
  ],
47
  outputs="text",
48
  title="逐字稿漏掉檢查工具",
 
21
  # 提取結束時間部分
22
  time_str = line.split(" - ")[1].strip()
23
  # 將時間戳轉換為秒數
24
+ h, m, s = map(int, time_str.split(":"))
25
  total_seconds = h * 3600 + m * 60 + s
26
  end_times.append(total_seconds)
27
 
 
42
  fn=check_transcript,
43
  inputs=[
44
  gr.Textbox(lines=10, label="逐字稿文本"),
45
+ gr.Number(value=10, label="時間間隔閾值(秒數)") # 使用 value 而不是 default
46
  ],
47
  outputs="text",
48
  title="逐字稿漏掉檢查工具",