Manasa1 commited on
Commit
ad1cbcf
·
verified ·
1 Parent(s): 8fdc4b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -19,17 +19,23 @@ 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
- # Generate Comedy Script
 
 
 
 
 
 
 
 
23
  def generate_comedy_script(prompt):
24
- response = client.chat.completions.create(
25
  messages=[
26
- {"role": "user", "content": prompt}
27
  ],
28
- model="llama-3.1"
29
- )
30
- script = response["choices"][0]["message"]["content"]
31
  return script
32
-
33
  # Convert Text to Speech using Coqui TTS
34
  def text_to_speech(script):
35
  output_audio = 'output.wav'
 
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
+ )[0]['generated_text']
 
38
  return script
 
39
  # Convert Text to Speech using Coqui TTS
40
  def text_to_speech(script):
41
  output_audio = 'output.wav'