orrinin commited on
Commit
f2cf2ce
·
verified ·
1 Parent(s): 6fde70c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -15,13 +15,13 @@ from pydub import AudioSegment
15
  from moviepy.editor import AudioFileClip, concatenate_audioclips
16
 
17
  system_prompt = '''
18
- You are an news podcast generator. You have to create short conversations between Chen and Yun that gives an overview of the News given by the user.
19
  Please provide the script and output strictly in the following JSON format:
20
  {
21
  "title": "[string]",
22
  "content": {
23
- "Chen_0: "[string]",
24
- "Yun_0": "[string]",
25
  ...
26
  }
27
  }
@@ -31,10 +31,11 @@ system_prompt = '''
31
 
32
  DESCRIPTION = '''
33
  <div>
34
- <h1 style="text-align: center;">听说demo</h1>
35
  <p>一个轻量的中文播客</p>
36
  <p>🔎 输入完整的网页链接发送即可。</p>
37
  <p>🦕 部分网址可能无法解析,请尝试更换。</p>
 
38
  </div>
39
  '''
40
 
@@ -51,7 +52,7 @@ footer {
51
  }
52
  """
53
 
54
- rss_feed = 'https://www.yahoo.com/news/rss'
55
 
56
 
57
  apikey = os.environ.get("API_KEY")
@@ -108,7 +109,7 @@ async def gen_show(script):
108
  for key, text in content.items():
109
  speaker = key.split('_')[0] # Extract the speaker name
110
  index = key.split('_')[1] # Extract the dialogue index
111
- voice = "zh-CN-XiaoxiaoNeural" if speaker == "Chen" else "zh-CN-YunyangNeural"
112
 
113
  # Create temporary file for each speaker's dialogue
114
  temp_file = tempfile.NamedTemporaryFile(suffix='.mp3', delete=False)
 
15
  from moviepy.editor import AudioFileClip, concatenate_audioclips
16
 
17
  system_prompt = '''
18
+ You are a popular podcast generator. You have to create short conversations between Xiao and Yang that gives an overview of the News given by the user.
19
  Please provide the script and output strictly in the following JSON format:
20
  {
21
  "title": "[string]",
22
  "content": {
23
+ "Xiao_0: "[string]",
24
+ "Yang_0": "[string]",
25
  ...
26
  }
27
  }
 
31
 
32
  DESCRIPTION = '''
33
  <div>
34
+ <h1 style="text-align: center;">📻听说demo</h1>
35
  <p>一个轻量的中文播客</p>
36
  <p>🔎 输入完整的网页链接发送即可。</p>
37
  <p>🦕 部分网址可能无法解析,请尝试更换。</p>
38
+ <p>🍀 点击随机将随机获取科学资讯。</p>
39
  </div>
40
  '''
41
 
 
52
  }
53
  """
54
 
55
+ rss_feed = 'https://www.scmp.com/rss/318224/feed'
56
 
57
 
58
  apikey = os.environ.get("API_KEY")
 
109
  for key, text in content.items():
110
  speaker = key.split('_')[0] # Extract the speaker name
111
  index = key.split('_')[1] # Extract the dialogue index
112
+ voice = "zh-CN-XiaoxiaoNeural" if speaker == "Xiao" else "zh-CN-YunyangNeural"
113
 
114
  # Create temporary file for each speaker's dialogue
115
  temp_file = tempfile.NamedTemporaryFile(suffix='.mp3', delete=False)