Update app.py
Browse files
app.py
CHANGED
@@ -15,18 +15,18 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
15 |
from moviepy.editor import AudioFileClip, concatenate_audioclips
|
16 |
|
17 |
system_prompt = '''
|
18 |
-
You are an
|
19 |
-
Please provide the script in the following JSON format
|
20 |
{
|
21 |
-
"title": "
|
22 |
"content": {
|
23 |
-
"Alice_0": "
|
24 |
-
"BOB_0": "
|
25 |
...
|
26 |
}
|
27 |
}
|
28 |
-
Please note that the
|
29 |
-
No more than five rounds of conversation.
|
30 |
'''
|
31 |
|
32 |
DESCRIPTION = '''
|
@@ -43,6 +43,9 @@ h1 {
|
|
43 |
text-align: center;
|
44 |
display: block;
|
45 |
}
|
|
|
|
|
|
|
46 |
footer {
|
47 |
display:none !important
|
48 |
}
|
@@ -94,7 +97,7 @@ async def gen_show(script):
|
|
94 |
for key, text in content.items():
|
95 |
speaker = key.split('_')[0] # Extract the speaker name
|
96 |
index = key.split('_')[1] # Extract the dialogue index
|
97 |
-
voice = "
|
98 |
|
99 |
# Create temporary file for each speaker's dialogue
|
100 |
temp_file = tempfile.NamedTemporaryFile(suffix='.mp3', delete=False)
|
|
|
15 |
from moviepy.editor import AudioFileClip, concatenate_audioclips
|
16 |
|
17 |
system_prompt = '''
|
18 |
+
You are an Chinese podcast generator. You have to create short conversations between Alice and Bob that gives an overview of the News given by the user.
|
19 |
+
Please provide the script in the following JSON format directly:
|
20 |
{
|
21 |
+
"title": "[string]",
|
22 |
"content": {
|
23 |
+
"Alice_0": "[string]",
|
24 |
+
"BOB_0": "[string]",
|
25 |
...
|
26 |
}
|
27 |
}
|
28 |
+
Please note that the [string] you generate now must be in Chinese and based on the tone of people's daily life.
|
29 |
+
No more than five rounds of conversation, be concise.
|
30 |
'''
|
31 |
|
32 |
DESCRIPTION = '''
|
|
|
43 |
text-align: center;
|
44 |
display: block;
|
45 |
}
|
46 |
+
p {
|
47 |
+
text-align: center;
|
48 |
+
}
|
49 |
footer {
|
50 |
display:none !important
|
51 |
}
|
|
|
97 |
for key, text in content.items():
|
98 |
speaker = key.split('_')[0] # Extract the speaker name
|
99 |
index = key.split('_')[1] # Extract the dialogue index
|
100 |
+
voice = "zh-CN-XiaoxiaoNeural" if speaker == "Alice" else "zh-CN-YunjianNeural"
|
101 |
|
102 |
# Create temporary file for each speaker's dialogue
|
103 |
temp_file = tempfile.NamedTemporaryFile(suffix='.mp3', delete=False)
|