flocolombari commited on
Commit
199eed7
·
1 Parent(s): d35200a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -43,14 +43,15 @@ def video_to_descriptions(video, target_language="en"):
43
  cap.release()
44
 
45
  # Concatenate the descriptions
46
- concatenated_descriptions = " ".join(descriptions)
47
- concatenated_descriptions = Summarize(concatenated_descriptions, max_length=31)
48
- print("SUMMARIZATION : " + Summarize(concatenated_descriptions, max_length=31))
49
- # Translate the summarized text into the target language
50
- print("TRANSLATION : " + translator(concatenated_descriptions[0]["summary"]))
51
- translated_text = translator(concatenated_descriptions[0]["summary"])[0]["translation_text"]
52
- print("AUDIO : " + audio(translated_text))
53
  audio_file = audio(translated_text)[0]["audio"]
 
54
 
55
  return audio_file
56
 
 
43
  cap.release()
44
 
45
  # Concatenate the descriptions
46
+ concatenated_description = " ".join(descriptions)
47
+ summarized_description = Summarize(concatenated_description, max_length=31)[0]["summary_text"]
48
+ print("SUMMARIZATION : " + summarized_description)
49
+
50
+ translated_text = translator(summarized_description)[0]["translation_text"]
51
+ print("TRANSLATION : " + translated_text)
52
+
53
  audio_file = audio(translated_text)[0]["audio"]
54
+ print("AUDIO : " + audio_file)
55
 
56
  return audio_file
57