Spaces:
Runtime error
Runtime error
Commit
·
5d80bfb
1
Parent(s):
c22d94a
Use Nepali song generation prompt and different text3speech api
Browse files
app.py
CHANGED
@@ -36,8 +36,9 @@ def image_to_text(url, use_api=True):
|
|
36 |
# LLM
|
37 |
def generate_story(story_idea):
|
38 |
template = """
|
39 |
-
You are a professional
|
40 |
-
Generate a
|
|
|
41 |
CONTEXT: {story_idea}
|
42 |
STORY:
|
43 |
"""
|
@@ -49,7 +50,7 @@ def generate_story(story_idea):
|
|
49 |
|
50 |
# text to speech
|
51 |
def text_to_speech(story):
|
52 |
-
API_URL = "https://api-inference.huggingface.co/models/
|
53 |
headers = {"Authorization": f"Bearer {HUGGINGFACEHUB_API_TOKEN}"}
|
54 |
|
55 |
payloads = {
|
|
|
36 |
# LLM
|
37 |
def generate_story(story_idea):
|
38 |
template = """
|
39 |
+
You are a professional song writter;
|
40 |
+
Generate a song based on a simple narrative, the song should be no more than 100 words.
|
41 |
+
Song should be in Nepali language
|
42 |
CONTEXT: {story_idea}
|
43 |
STORY:
|
44 |
"""
|
|
|
50 |
|
51 |
# text to speech
|
52 |
def text_to_speech(story):
|
53 |
+
API_URL = "https://api-inference.huggingface.co/models/openai/whisper-large-v2"
|
54 |
headers = {"Authorization": f"Bearer {HUGGINGFACEHUB_API_TOKEN}"}
|
55 |
|
56 |
payloads = {
|