Update app.py
Browse files
app.py
CHANGED
@@ -121,9 +121,13 @@ LINKS = """<a href='https://blog.twman.org/2021/04/ASR.html' target='_blank'>那
|
|
121 |
<a href='https://blog.twman.org/2023/07/wsl.html' target='_blank'>用PaddleOCR的PPOCRLabel來微調醫療診斷書和收據</a> | <a href='https://blog.twman.org/2023/07/HugIE.html' target='_blank'>基於機器閱讀理解和指令微調的統一信息抽取框架之診斷書醫囑資訊擷取分析</a><br>
|
122 |
<a href='https://huggingface.co/spaces/DeepLearning101/High-Entropy-Alloys-FAQ/blob/main/reference.txt' target='_blank'>「高熵合金」(High-entropy alloys) 參考論文</a><br>"""
|
123 |
|
124 |
-
|
|
|
|
|
|
|
|
|
125 |
|
126 |
-
with iface:
|
127 |
gr.HTML(TITLE)
|
128 |
gr.HTML(SUBTITLE)
|
129 |
gr.HTML(LINKS)
|
@@ -158,10 +162,12 @@ with iface:
|
|
158 |
|
159 |
show_feedback_button.click(fn=show_feedback, outputs=feedback_display)
|
160 |
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
|
|
|
|
166 |
|
167 |
-
|
|
|
121 |
<a href='https://blog.twman.org/2023/07/wsl.html' target='_blank'>用PaddleOCR的PPOCRLabel來微調醫療診斷書和收據</a> | <a href='https://blog.twman.org/2023/07/HugIE.html' target='_blank'>基於機器閱讀理解和指令微調的統一信息抽取框架之診斷書醫囑資訊擷取分析</a><br>
|
122 |
<a href='https://huggingface.co/spaces/DeepLearning101/High-Entropy-Alloys-FAQ/blob/main/reference.txt' target='_blank'>「高熵合金」(High-entropy alloys) 參考論文</a><br>"""
|
123 |
|
124 |
+
# 添加示例
|
125 |
+
examples = [
|
126 |
+
["AlCoCrFeNi HEA coating 可用怎樣的實驗方法做到 ?"],
|
127 |
+
["請問high entropy nitride coatings的形成,主要可透過那些元素來熱這個材料形成熱穩定?"]
|
128 |
+
]
|
129 |
|
130 |
+
with gr.Blocks() as iface:
|
131 |
gr.HTML(TITLE)
|
132 |
gr.HTML(SUBTITLE)
|
133 |
gr.HTML(LINKS)
|
|
|
162 |
|
163 |
show_feedback_button.click(fn=show_feedback, outputs=feedback_display)
|
164 |
|
165 |
+
demo = gr.Interface(
|
166 |
+
fn=handle_user_input,
|
167 |
+
inputs=user_input,
|
168 |
+
outputs=response_output,
|
169 |
+
examples=examples,
|
170 |
+
live=True
|
171 |
+
)
|
172 |
|
173 |
+
demo.launch()
|