Munaf1987 commited on
Commit
52d16d3
·
verified ·
1 Parent(s): 0f7ba4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -7,10 +7,10 @@ import os
7
  import spaces
8
 
9
  # Text Expansion Model (ZeroGPU compatible)
10
- text_generator = pipeline("text-generation", model="tiiuae/falcon-7b-instruct")
11
 
12
- # Text-to-Speech Model (Bark small)
13
- tts_pipeline = pipeline("text-to-speech", model="suno/bark-small")
14
 
15
  # Image Generation Model (LoRA-based)
16
  image_generator = pipeline("text-to-image", model="stabilityai/sdxl-turbo")
@@ -20,19 +20,15 @@ image_generator = pipeline("text-to-image", model="stabilityai/sdxl-turbo")
20
  def generate_cartoon(script_text):
21
  # Step 1: Expand Script
22
  prompt = f"""
23
- You are a cartoon script writer. Convert the following story into a detailed cartoon scene plan.
24
- For each scene, provide:
25
- 1. Scene description (setting + action)
26
  2. Dialogue
27
  3. Characters involved
28
  4. Background description
29
 
30
  Story:
31
- """
32
  {script_text}
33
  """
34
- Return result in JSON format.
35
- """
36
 
37
  response = text_generator(prompt, max_new_tokens=1024)[0]['generated_text']
38
 
 
7
  import spaces
8
 
9
  # Text Expansion Model (ZeroGPU compatible)
10
+ text_generator = pipeline("text2text-generation", model="google/flan-t5-large")
11
 
12
+ # Text-to-Speech Model (ZeroGPU compatible)
13
+ tts_pipeline = pipeline("text-to-speech", model="facebook/fastspeech2-en-ljspeech")
14
 
15
  # Image Generation Model (LoRA-based)
16
  image_generator = pipeline("text-to-image", model="stabilityai/sdxl-turbo")
 
20
  def generate_cartoon(script_text):
21
  # Step 1: Expand Script
22
  prompt = f"""
23
+ Convert the following cartoon story into a detailed scene plan in JSON format. For each scene, provide:
24
+ 1. Scene description
 
25
  2. Dialogue
26
  3. Characters involved
27
  4. Background description
28
 
29
  Story:
 
30
  {script_text}
31
  """
 
 
32
 
33
  response = text_generator(prompt, max_new_tokens=1024)[0]['generated_text']
34