xTHExBEASTx commited on
Commit
f476ef1
·
verified ·
1 Parent(s): 694cbe6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -31,7 +31,7 @@ def batch_translate(texts, batch_size=8):
31
  return results
32
 
33
  def process_srt(filepath):
34
- # In Gradio 4, filepath is a string, not an object
35
  if filepath is None:
36
  return None
37
 
@@ -56,14 +56,14 @@ def process_srt(filepath):
56
  return output_path
57
 
58
  # --- Gradio Interface ---
59
- with gr.Blocks(title="NLLB SRT Translator") as demo:
60
  gr.Markdown("# 🇬🇧 English to 🇸🇦 Arabic SRT Translator")
61
 
62
  with gr.Row():
63
  input_file = gr.File(label="Upload English SRT", file_types=[".srt"])
64
  output_file = gr.File(label="Download Arabic SRT")
65
 
66
- btn = gr.Button("Translate Subtitles", variant="primary")
67
  btn.click(fn=process_srt, inputs=input_file, outputs=output_file)
68
 
69
  if __name__ == "__main__":
 
31
  return results
32
 
33
  def process_srt(filepath):
34
+ # Gradio 4 passes the file path as a string
35
  if filepath is None:
36
  return None
37
 
 
56
  return output_path
57
 
58
  # --- Gradio Interface ---
59
+ with gr.Blocks(title="SRT Translator") as demo:
60
  gr.Markdown("# 🇬🇧 English to 🇸🇦 Arabic SRT Translator")
61
 
62
  with gr.Row():
63
  input_file = gr.File(label="Upload English SRT", file_types=[".srt"])
64
  output_file = gr.File(label="Download Arabic SRT")
65
 
66
+ btn = gr.Button("Translate", variant="primary")
67
  btn.click(fn=process_srt, inputs=input_file, outputs=output_file)
68
 
69
  if __name__ == "__main__":