Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,22 +19,13 @@ image_generator = StableDiffusionPipeline.from_pretrained("stabilityai/stable-di
|
|
19 |
# Use Coqui TTS (open-source) for text-to-speech
|
20 |
tts = TTS(model_name="tts_models/en/ljspeech/tacotron2-DDC", progress_bar=False, gpu=False)
|
21 |
|
22 |
-
chat_completion = client.chat.completions.create(
|
23 |
-
messages=[
|
24 |
-
{
|
25 |
-
"role": "user",
|
26 |
-
"content": "Explain the importance of fast language models",
|
27 |
-
}
|
28 |
-
],
|
29 |
-
model="llama3-8b-8192",
|
30 |
-
)
|
31 |
def generate_comedy_script(prompt):
|
32 |
script = client.chat.completions.create(
|
33 |
messages=[
|
34 |
{"role": "user", "content": "write a comedy scipt on {prompt}"}
|
35 |
],
|
36 |
model="llama3-8b-8192"
|
37 |
-
|
38 |
return script
|
39 |
# Convert Text to Speech using Coqui TTS
|
40 |
def text_to_speech(script):
|
|
|
19 |
# Use Coqui TTS (open-source) for text-to-speech
|
20 |
tts = TTS(model_name="tts_models/en/ljspeech/tacotron2-DDC", progress_bar=False, gpu=False)
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
def generate_comedy_script(prompt):
|
23 |
script = client.chat.completions.create(
|
24 |
messages=[
|
25 |
{"role": "user", "content": "write a comedy scipt on {prompt}"}
|
26 |
],
|
27 |
model="llama3-8b-8192"
|
28 |
+
script = response['choices'][0]['message']['content']
|
29 |
return script
|
30 |
# Convert Text to Speech using Coqui TTS
|
31 |
def text_to_speech(script):
|