Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,12 +13,15 @@ def generate_comedy_script(prompt):
|
|
13 |
result = script_generator(prompt, max_length=150, num_return_sequences=1)
|
14 |
return result[0]["generated_text"]
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
22 |
|
23 |
# Function to generate simple animated text video using MoviePy
|
24 |
def generate_animation(script, output_video_file="animated_script.mp4"):
|
|
|
13 |
result = script_generator(prompt, max_length=150, num_return_sequences=1)
|
14 |
return result[0]["generated_text"]
|
15 |
|
16 |
+
from gtts import gTTS
|
17 |
+
import os
|
18 |
+
|
19 |
+
def text_to_speech(script):
|
20 |
+
tts = gTTS(text=script, lang='en')
|
21 |
+
audio_file = "output.mp3"
|
22 |
+
tts.save(audio_file)
|
23 |
+
return audio_file
|
24 |
+
|
25 |
|
26 |
# Function to generate simple animated text video using MoviePy
|
27 |
def generate_animation(script, output_video_file="animated_script.mp4"):
|