Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -80,34 +80,32 @@ def generate_response(input_text, language, speaker1, speaker2, api_key):
|
|
80 |
}
|
81 |
"""
|
82 |
|
83 |
-
system_prompt = f"""
|
84 |
|
85 |
以下是你將要處理的輸入文字:
|
86 |
<input_text>
|
87 |
{{input_text}}
|
88 |
</input_text>
|
89 |
|
90 |
-
|
91 |
|
92 |
<scratchpad>
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
將你的頭腦風暴想法和播客對話的粗略大綱寫在這裡,務必讓它有趣且吸引人。確保記錄下你希望在結尾重申的主要見解和要點。
|
97 |
</scratchpad>
|
98 |
|
99 |
-
|
100 |
{language_instruction}
|
101 |
-
- The podcast should
|
102 |
-
- The podcast should be long.
|
103 |
- The podcast should be interesting, lively, and engaging, and hook the listener from the start.
|
104 |
- The script must be in JSON format.
|
105 |
Follow this JSON example structure, MUST be in {language} language:
|
106 |
{example}
|
107 |
|
108 |
<podcast_dialogue>
|
109 |
-
根據你在頭腦風暴階段提出的關鍵點和創造性想法,撰寫一段引人入勝且訊息豐富的播客對話(至少1000
|
110 |
-
確保對話儘可能詳細且完整,同時保持在主題之內並維持吸引人的流暢性,避免每句開頭使用"好的"、"是的"
|
111 |
在對話結束時,讓主持人和專家自然總結他們討論中的主要見解和要點,這應當是對話的隨機部分,以自然隨意而非明顯刻意的總結 - 目的是在結束前最後一次以自然流暢的方式強化核心思想。
|
112 |
</podcast_dialogue>
|
113 |
"""
|
@@ -444,7 +442,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as iface:
|
|
444 |
api_key = gr.Textbox(label="請輸入您的 API Key", type="password", placeholder="API authentication key for large language models", scale=1, elem_classes="api-background")
|
445 |
|
446 |
audio_output = gr.Audio(label="Generated Podcast Audio", elem_classes="audio-background")
|
447 |
-
podcast_script = gr.Textbox(label="Generated Podcast
|
448 |
generate_button.click(fn=process_podcast, inputs=[input_text, fileName, Language, Speaker_1, Speaker_2, api_key], outputs=[podcast_script, audio_output])
|
449 |
|
450 |
|
|
|
80 |
}
|
81 |
"""
|
82 |
|
83 |
+
system_prompt = f"""你的任務是將提供的輸入文字轉換為一個訊息豐富、吸引人且專業的播客對話。輸入文字可能會比較混亂或結構不完整,因為它可能來自不同來源,如PDF檔案或網頁文字等。不要擔心格式問題或任何不相關的訊息;你的目標是超越表面訊息提取可以在播客中討論的關鍵點和知識精華,並突顯有趣的事實。
|
84 |
|
85 |
以下是你將要處理的輸入文字:
|
86 |
<input_text>
|
87 |
{{input_text}}
|
88 |
</input_text>
|
89 |
|
90 |
+
首先,仔細閱讀輸入文字,並Chain-of-Thought積極找出主要話題、關鍵點、令人印象深刻的細節,以及任何有趣的事實或軼事。思考如何將這些訊息以有趣且吸引人的方式呈現出來,以適合高品質的播客劇本。
|
91 |
|
92 |
<scratchpad>
|
93 |
+
頭腦風暴創造性的方法來深度探討你在輸入文字中識別出的主要話題、"key insights"及"golden nuggets of knowledge",儘可能思考使用真實生活的範例、講故事技巧或假設情境來讓內容更能吸引聽眾並讓他們感覺學習到新的知識。
|
94 |
+
請記住,你的播客應當結構清晰和引人入勝並易於普通聽眾理解,避免使用過多的專業術語或假設聽眾對該話題已有瞭解。發揮你的想像力填補輸入文字中的任何空白,或頭腦風暴提出一些值得深入探討與發人深省的問題,以供播客討論。目標是創造一個訊息豐富且娛樂性強的對話,因此可以在你的方法上大膽盡情自由發揮創意。
|
95 |
+
將你的頭腦風暴想法和播客對話的大綱寫在這裡,務必讓它有趣且吸引人。確保記錄下你希望在結尾重申的主要見解和觀點。
|
|
|
96 |
</scratchpad>
|
97 |
|
98 |
+
現在你已經進行頭腦風暴並建立大綱,該開始撰寫實際的播客對話了。目標是主持人與專家之間自然、對話式的交流,融入你在頭腦風暴中得出的最佳想法,並花費精力確保將任何複雜話題以易於理解的方式解釋清楚,現實生活中的例子和相關的軼事對於讓訊息深入人心至關重要。
|
99 |
{language_instruction}
|
100 |
+
- The podcast should be most long.
|
|
|
101 |
- The podcast should be interesting, lively, and engaging, and hook the listener from the start.
|
102 |
- The script must be in JSON format.
|
103 |
Follow this JSON example structure, MUST be in {language} language:
|
104 |
{example}
|
105 |
|
106 |
<podcast_dialogue>
|
107 |
+
根據你在頭腦風暴階段提出的關鍵點和創造性想法,撰寫一段引人入勝且訊息豐富的播客對話(至少1000個字)。定義Host({speaker1_name})和Expert({speaker2_name})的角色,Using signposts to guide listeners and avoiding a monotone, robotic tone,Host以熱情的方式突出有趣且吸引人的觀點,而Expert則提供深入分析、背景訊息和更宏觀的見解。內容必須以清晰的概述開始,並包括任何必要的上下文或解釋,使內容對一般聽眾容易理解。使用Host名字 {speaker1_name} 和Expert名字 {speaker2_name},為聽眾營造更吸引人和身臨其境的聆聽體驗。不要包括像[Host]或[Expert]這樣的括號預留位置。設計你的輸出內容必須生動活潑、促進聽眾參與,並避免單調語氣與機器人般的語調,因為它將直接朗讀為音訊。
|
108 |
+
確保對話儘可能詳細且完整,同時保持在主題之內並維持吸引人的流暢性,避免每句開頭使用"好的"、"是的"。目標是使用你的全部輸出容量,建立儘可能最長的播客節目,同時以娛樂性的方式傳達輸入文字中的關鍵訊息,並追求引人入勝的學習體驗。
|
109 |
在對話結束時,讓主持人和專家自然總結他們討論中的主要見解和要點,這應當是對話的隨機部分,以自然隨意而非明顯刻意的總結 - 目的是在結束前最後一次以自然流暢的方式強化核心思想。
|
110 |
</podcast_dialogue>
|
111 |
"""
|
|
|
442 |
api_key = gr.Textbox(label="請輸入您的 API Key", type="password", placeholder="API authentication key for large language models", scale=1, elem_classes="api-background")
|
443 |
|
444 |
audio_output = gr.Audio(label="Generated Podcast Audio", elem_classes="audio-background")
|
445 |
+
podcast_script = gr.Textbox(label="Generated Podcast 劇本", elem_classes="script-background")
|
446 |
generate_button.click(fn=process_podcast, inputs=[input_text, fileName, Language, Speaker_1, Speaker_2, api_key], outputs=[podcast_script, audio_output])
|
447 |
|
448 |
|