Spaces:
Running
Running
Prudvireddy
commited on
Commit
•
d20cb1b
1
Parent(s):
72d0751
Update tools.py
Browse files
tools.py
CHANGED
@@ -122,6 +122,7 @@ def apply_zoom_in_effect(clip, zoom_factor=1.2):
|
|
122 |
|
123 |
return clip.fl(zoom_in_effect, apply_to=['mask'])
|
124 |
|
|
|
125 |
def create_video_from_images_and_audio(images_dir, speeches_dir, zoom_factor=1.2):
|
126 |
client = Groq(api_key='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')
|
127 |
images_paths = sorted(os.listdir(images_dir))
|
@@ -227,6 +228,7 @@ def generate_speech(text, lang='en', speed=1.15, num=0):
|
|
227 |
temp_speech_file.close()
|
228 |
return temp_speech_path
|
229 |
|
|
|
230 |
def image_generator(script):
|
231 |
"""Generates images for the given script.
|
232 |
Saves it to a temporary directory and returns the path.
|
@@ -258,7 +260,7 @@ def image_generator(script):
|
|
258 |
|
259 |
return images_dir
|
260 |
|
261 |
-
|
262 |
def speech_generator(script):
|
263 |
"""
|
264 |
Generates speech files for the given script using gTTS.
|
|
|
122 |
|
123 |
return clip.fl(zoom_in_effect, apply_to=['mask'])
|
124 |
|
125 |
+
@tool
|
126 |
def create_video_from_images_and_audio(images_dir, speeches_dir, zoom_factor=1.2):
|
127 |
client = Groq(api_key='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')
|
128 |
images_paths = sorted(os.listdir(images_dir))
|
|
|
228 |
temp_speech_file.close()
|
229 |
return temp_speech_path
|
230 |
|
231 |
+
@tool
|
232 |
def image_generator(script):
|
233 |
"""Generates images for the given script.
|
234 |
Saves it to a temporary directory and returns the path.
|
|
|
260 |
|
261 |
return images_dir
|
262 |
|
263 |
+
@tool
|
264 |
def speech_generator(script):
|
265 |
"""
|
266 |
Generates speech files for the given script using gTTS.
|