Lenylvt commited on
Commit
f439ce7
·
verified ·
1 Parent(s): 56e3ed2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -28,8 +28,12 @@ def translate_line(line, temperature=0.9, max_new_tokens=256, top_p=0.95, repeti
28
  return output
29
 
30
  def translate_srt(file_info):
31
- content = file_info['content'].decode("utf-8")
32
- translated_lines = [translate_line(line) for line in parse_srt(content)]
 
 
 
 
33
  return "\n".join(translated_lines)
34
 
35
  gr.Interface(
 
28
  return output
29
 
30
  def translate_srt(file_info):
31
+ # Assuming `file_info` is the file content as a bytes object directly
32
+ content = file_info.decode("utf-8") # Decode content from bytes to string
33
+ translated_lines = []
34
+ for line in parse_srt(content):
35
+ translated_line = translate_line(line)
36
+ translated_lines.append(translated_line)
37
  return "\n".join(translated_lines)
38
 
39
  gr.Interface(