Lenylvt commited on
Commit
db77ec0
·
verified ·
1 Parent(s): 735f37c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -18,9 +18,7 @@ def text_to_srt(text):
18
  def export_file(srt_content):
19
  if srt_content.strip() == "":
20
  return None
21
- # Convert string to bytes and then to a file-like object
22
- bytes_io = io.BytesIO(srt_content.encode('utf-8'))
23
- return bytes_io, "output.srt"
24
 
25
  with gr.Blocks() as app:
26
  gr.Markdown("### Text to SRT Converter")
 
18
  def export_file(srt_content):
19
  if srt_content.strip() == "":
20
  return None
21
+ return gr.File(content=srt_content.encode('utf-8'), file_name="output.srt")
 
 
22
 
23
  with gr.Blocks() as app:
24
  gr.Markdown("### Text to SRT Converter")