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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -28,8 +28,8 @@ 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
- # 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)
 
28
  return output
29
 
30
  def translate_srt(file_info):
31
+ # Correctly access the file content from the file_info dictionary
32
+ content = file_info["content"].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)