Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -87,16 +87,16 @@ def generate_response(input_text, language, speaker1, speaker2, api_key):
|
|
87 |
{{input_text}}
|
88 |
</input_text>
|
89 |
|
90 |
-
|
91 |
|
92 |
<scratchpad>
|
93 |
-
|
94 |
-
|
95 |
發揮你的想像力填補輸入文字中的任何空白,或頭腦風暴提出一些值得探討與發人深省的問題,以供播客討論。目標是創造一個訊息豐富且娛樂性強的對話,因此可以在你的方法上大膽盡情自由發揮創意。
|
96 |
將你的頭腦風暴想法和播客對話的粗略大綱寫在這裡,務必讓它有趣且吸引人。確保記錄下你希望在結尾重申的主要見解和要點。
|
97 |
</scratchpad>
|
98 |
|
99 |
-
現在你已經進行頭腦風暴並建立粗略大綱,是時候撰寫實際的播客對話了。目標是主持人({speaker1_name})
|
100 |
{language_instruction}
|
101 |
- The podcast should have 2 speakers: {speaker1_name} and {speaker2_name}.
|
102 |
- The podcast should be long.
|
@@ -106,9 +106,9 @@ Follow this JSON example structure, MUST be in {language} language:
|
|
106 |
{example}
|
107 |
|
108 |
<podcast_dialogue>
|
109 |
-
|
110 |
確保對話儘可能詳細且完整,同時保持在主題之內並維持吸引人的流暢性。目標是使用你的全部輸出容量,建立儘可能長的播客節目,同時以娛樂性的方式傳達輸入文字中的關鍵訊息。
|
111 |
-
|
112 |
</podcast_dialogue>
|
113 |
"""
|
114 |
client = create_client(api_key)
|
@@ -295,7 +295,7 @@ custom_css = """
|
|
295 |
border-radius: 10px !important;
|
296 |
margin: 0 !important;
|
297 |
}
|
298 |
-
.lng-background
|
299 |
background-color: #ffffff;
|
300 |
border: 1px solid #f0f8ff;
|
301 |
border-radius: 8px;
|
@@ -306,7 +306,7 @@ custom_css = """
|
|
306 |
border-radius: 10px !important;
|
307 |
margin: 0 !important;
|
308 |
}
|
309 |
-
.sk1-background
|
310 |
background-color: #ffffff;
|
311 |
border: 1px solid #f0f8ff;
|
312 |
border-radius: 8px;
|
@@ -317,7 +317,7 @@ custom_css = """
|
|
317 |
border-radius: 10px !important;
|
318 |
margin: 0 !important;
|
319 |
}
|
320 |
-
.sk2-background
|
321 |
background-color: #ffffff;
|
322 |
border: 1px solid #f0f8ff;
|
323 |
border-radius: 8px;
|
@@ -369,9 +369,10 @@ with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as iface:
|
|
369 |
input_text = gr.Textbox(
|
370 |
label="請輸入 Podcast 話題(建議50至1000字)",
|
371 |
placeholder="受限 LLM Context Length,建議1000字以內......",
|
372 |
-
|
373 |
max_lines=20,
|
374 |
-
scale=4
|
|
|
375 |
)
|
376 |
fileName = gr.File(
|
377 |
file_types=[".pdf", ".txt"],
|
|
|
87 |
{{input_text}}
|
88 |
</input_text>
|
89 |
|
90 |
+
首先,仔細閱讀輸入文字,並積極找出主要話題、關鍵點、難忘的細節,以及任何有趣的事實或軼事。Chain-of-Thought思考如何將這些訊息以一種有趣且吸引人的方式呈現出來,適合高品質的播客文稿。
|
91 |
|
92 |
<scratchpad>
|
93 |
+
頭腦風暴一些創造性的方法來深度探討你在輸入文字中識別出的主要話題、"key insights"及"golden nuggets of knowledge",可以考慮使用類比、例子、講故事技巧或假設情境來讓內容更能吸引聽眾並讓他們感覺學到了新東西。
|
94 |
+
請記住,你的播客應當結構清晰易於普通聽眾理解,所以避免使用過多的專業術語或假設聽眾對該話題已有瞭解。Using signposts to guide listeners and avoiding a monotone, robotic tone。
|
95 |
發揮你的想像力填補輸入文字中的任何空白,或頭腦風暴提出一些值得探討與發人深省的問題,以供播客討論。目標是創造一個訊息豐富且娛樂性強的對話,因此可以在你的方法上大膽盡情自由發揮創意。
|
96 |
將你的頭腦風暴想法和播客對話的粗略大綱寫在這裡,務必讓它有趣且吸引人。確保記錄下你希望在結尾重申的主要見解和要點。
|
97 |
</scratchpad>
|
98 |
|
99 |
+
現在你已經進行頭腦風暴並建立粗略大綱,是時候撰寫實際的播客對話了。目標是主持人({speaker1_name})與專家({speaker2_name})之間自然、對話式的交流,融入你在頭腦風暴中得出的最佳想法,並花費精力確保將任何複雜話題以易於理解的方式解釋清楚,真實世界的例子和相關的軼事對於讓訊息深入人心至關重要。
|
100 |
{language_instruction}
|
101 |
- The podcast should have 2 speakers: {speaker1_name} and {speaker2_name}.
|
102 |
- The podcast should be long.
|
|
|
106 |
{example}
|
107 |
|
108 |
<podcast_dialogue>
|
109 |
+
根據你在頭腦風暴階段提出的關鍵點和創造性想法,撰寫一段引人入勝且訊息豐富的播客對話。採用對話式的語氣,定義主持人({speaker1_name})和專家({speaker2_name})的角色,主持人以熱情的方式突出有趣且吸引人的觀點,而專家則提供分析、背景和更廣泛的觀點。內容必須以清晰的概述開始,保持中立的立場,並包括任何必要的上下文或解釋,使內容對一般聽眾容易理解。使用主持人名字 {speaker1_name} 和專家名字 {speaker2_name},為聽眾營造更吸引人和身臨其境的聆聽體驗。不要包括像[主持人]或[專家]這樣的括號預留位置。設計你的輸出內容必須生動化、促進參與,並適合直接朗讀,因為它將直接轉換為音訊。
|
110 |
確保對話儘可能詳細且完整,同時保持在主題之內並維持吸引人的流暢性。目標是使用你的全部輸出容量,建立儘可能長的播客節目,同時以娛樂性的方式傳達輸入文字中的關鍵訊息。
|
111 |
+
在對話結束時,讓主持人和專家自然總結他們討論中的主要見解和要點,這應當是對話的隨機部分,以自然隨意而非明顯刻意的總結 - 目的是在結束前最後一次以自然流暢的方式強化核心思想。最終以感謝詞結束。
|
112 |
</podcast_dialogue>
|
113 |
"""
|
114 |
client = create_client(api_key)
|
|
|
295 |
border-radius: 10px !important;
|
296 |
margin: 0 !important;
|
297 |
}
|
298 |
+
.lng-background select {
|
299 |
background-color: #ffffff;
|
300 |
border: 1px solid #f0f8ff;
|
301 |
border-radius: 8px;
|
|
|
306 |
border-radius: 10px !important;
|
307 |
margin: 0 !important;
|
308 |
}
|
309 |
+
.sk1-background select {
|
310 |
background-color: #ffffff;
|
311 |
border: 1px solid #f0f8ff;
|
312 |
border-radius: 8px;
|
|
|
317 |
border-radius: 10px !important;
|
318 |
margin: 0 !important;
|
319 |
}
|
320 |
+
.sk2-background select {
|
321 |
background-color: #ffffff;
|
322 |
border: 1px solid #f0f8ff;
|
323 |
border-radius: 8px;
|
|
|
369 |
input_text = gr.Textbox(
|
370 |
label="請輸入 Podcast 話題(建議50至1000字)",
|
371 |
placeholder="受限 LLM Context Length,建議1000字以內......",
|
372 |
+
autofocus=True,
|
373 |
max_lines=20,
|
374 |
+
scale=4,
|
375 |
+
elem_classes="input-background"
|
376 |
)
|
377 |
fileName = gr.File(
|
378 |
file_types=[".pdf", ".txt"],
|