Spaces:
Runtime error
Runtime error
gr.Examples(
Browse files
app.py
CHANGED
|
@@ -66,6 +66,37 @@ with gr.Blocks() as demo:
|
|
| 66 |
with gr.Column(1):
|
| 67 |
new_article = gr.Textbox(label="生成的文章")
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
generate_article_btn.click(
|
| 70 |
generate_article,
|
| 71 |
inputs =[reference_text, lesson_title, seed_words, derivative_words, grade, word_count, prompt_text],
|
|
|
|
| 66 |
with gr.Column(1):
|
| 67 |
new_article = gr.Textbox(label="生成的文章")
|
| 68 |
|
| 69 |
+
with gr.Row():
|
| 70 |
+
example_article = """
|
| 71 |
+
大雨過後,
|
| 72 |
+
太陽為小花充充電,
|
| 73 |
+
小花開了。
|
| 74 |
+
冬天過後,
|
| 75 |
+
太陽為土地充充電,
|
| 76 |
+
青草冒出來了。
|
| 77 |
+
大哭過後,
|
| 78 |
+
太陽為我充充電,
|
| 79 |
+
我開心的笑了。
|
| 80 |
+
"""
|
| 81 |
+
example_title = "太陽是充電機"
|
| 82 |
+
example_seed_words = "太充電雨過後為冬土草冒哭心陽機"
|
| 83 |
+
example_derivative_words = "陽機"
|
| 84 |
+
example_grade = "一年級"
|
| 85 |
+
example_word_count = 50
|
| 86 |
+
example_prompt_text = """
|
| 87 |
+
- 請依據課程標題,幫我產生跟文章參考類似的文章,
|
| 88 |
+
- 並包含文章生字與衍生生字,切記不要抄襲
|
| 89 |
+
- 且閱讀對象為 1 年級學生
|
| 90 |
+
- 字數跟 文章參考 接近
|
| 91 |
+
- 請直接提供課文就好,不需要前情提要,也不需要問題
|
| 92 |
+
"""
|
| 93 |
+
gr.Examples(
|
| 94 |
+
[
|
| 95 |
+
[example_article, example_title, example_seed_words, example_derivative_words, example_grade, example_word_count, example_prompt_text]
|
| 96 |
+
],
|
| 97 |
+
label="範例"
|
| 98 |
+
)
|
| 99 |
+
|
| 100 |
generate_article_btn.click(
|
| 101 |
generate_article,
|
| 102 |
inputs =[reference_text, lesson_title, seed_words, derivative_words, grade, word_count, prompt_text],
|