aiqcamp commited on
Commit
7d4416e
Β·
verified Β·
1 Parent(s): 8b9db3c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +56 -10
app.py CHANGED
@@ -1130,18 +1130,64 @@ with gr.Blocks(theme='ParityError/Interstellar') as demo:
1130
  chatbot = gr.Chatbot(
1131
  height=600,
1132
  type='messages' # λ©”μ‹œμ§€ ν˜•μ‹ 지정
1133
-
1134
  )
1135
- with gr.Row():
1136
- msg = gr.Textbox(
1137
- label="λ©”μ‹œμ§€λ₯Ό μž…λ ₯ν•˜μ„Έμš”",
1138
- placeholder="예: COVID-19λ₯Ό μΉ˜λ£Œν•  수 μžˆλŠ” λ‹¨λ°±μ§ˆμ„ μƒμ„±ν•΄μ£Όμ„Έμš”",
1139
- lines=2,
1140
- scale=4
1141
- )
1142
- submit_btn = gr.Button("전솑", variant="primary", scale=1)
1143
- clear = gr.Button("λŒ€ν™” λ‚΄μš© μ§€μš°κΈ°")
1144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1145
 
1146
 
1147
 
 
1130
  chatbot = gr.Chatbot(
1131
  height=600,
1132
  type='messages' # λ©”μ‹œμ§€ ν˜•μ‹ 지정
 
1133
  )
 
 
 
 
 
 
 
 
 
1134
 
1135
+ # 예제 ν”„λ‘¬ν”„νŠΈ λ“œλ‘­λ‹€μš΄ μΆ”κ°€
1136
+ example_prompts = [
1137
+ "μ•”μ„Έν¬λ§Œ μ„ νƒμ μœΌλ‘œ κ³΅κ²©ν•˜λŠ” λ©΄μ—­ λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1138
+ "COVID-19 슀파이크 λ‹¨λ°±μ§ˆμ— κ°•ν•˜κ²Œ κ²°ν•©ν•˜λŠ” 항체 λ‹¨λ°±μ§ˆμ„ μƒμ„±ν•΄μ£Όμ„Έμš”",
1139
+ "ν˜ˆλ‹Ή μˆ˜μ€€μ„ μ‹€μ‹œκ°„μœΌλ‘œ λͺ¨λ‹ˆν„°λ§ν•˜λŠ” λ‹¨λ°±μ§ˆμ„ λ§Œλ“€μ–΄μ£Όμ„Έμš”",
1140
+ "μ•ŒμΈ ν•˜μ΄λ¨Έ 베타 μ•„λ°€λ‘œμ΄λ“œλ₯Ό λΆ„ν•΄ν•  수 μžˆλŠ” νš¨μ†Œ λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1141
+ "μ•” 마컀λ₯Ό μ΄ˆκ³ κ°λ„λ‘œ κ²€μΆœν•˜λŠ” λ‹¨λ°±μ§ˆμ„ μƒμ„±ν•΄μ£Όμ„Έμš”",
1142
+ "ν”ŒλΌμŠ€ν‹±μ„ λΆ„ν•΄ν•  수 μžˆλŠ” νš¨μ†Œ λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1143
+ "μ΄μ‚°ν™”νƒ„μ†Œλ₯Ό 효율적으둜 ν¬μ§‘ν•˜λŠ” λ‹¨λ°±μ§ˆμ„ λ§Œλ“€μ–΄μ£Όμ„Έμš”",
1144
+ "μ‹ν’ˆμ˜ 보쑴기간을 μ—°μž₯ν•˜λŠ” ν•­κ·  λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1145
+ "μˆ˜μ†Œ 생산을 μ΄‰μ§„ν•˜λŠ” νš¨μ†Œ λ‹¨λ°±μ§ˆμ„ μƒμ„±ν•΄μ£Όμ„Έμš”",
1146
+ "ν˜ˆμ „μ„ 효과적으둜 λΆ„ν•΄ν•˜λŠ” λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1147
+ "인슐린 저항성을 κ°œμ„ ν•˜λŠ” μƒˆλ‘œμš΄ 호λ₯΄λͺ¬ λ‹¨λ°±μ§ˆμ„ λ§Œλ“€μ–΄μ£Όμ„Έμš”",
1148
+ "μ‹λ¬Όμ˜ κ°€λ­„ 저항성을 λ†’μ΄λŠ” λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1149
+ "νƒœμ–‘κ΄‘ μ—λ„ˆμ§€λ₯Ό 효율적으둜 ν¬μ§‘ν•˜λŠ” λ‹¨λ°±μ§ˆμ„ μƒμ„±ν•΄μ£Όμ„Έμš”",
1150
+ "ν•΄μˆ˜μ—μ„œ μ€‘κΈˆμ†μ„ μ œκ±°ν•˜λŠ” λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1151
+ "μ§ˆμ†Œ κ³ μ • νš¨μœ¨μ„ λ†’μ΄λŠ” νš¨μ†Œ λ‹¨λ°±μ§ˆμ„ λ§Œλ“€μ–΄μ£Όμ„Έμš”",
1152
+ "μ‹ κ²½μ „λ‹¬λ¬Όμ§ˆμ„ κ°μ§€ν•˜λŠ” λ‚˜λ…Έλ°”μ΄μ˜€μ„Όμ„œλ₯Ό μ„€κ³„ν•΄μ£Όμ„Έμš”",
1153
+ "νŠΉμ • 독성 λ¬Όμ§ˆμ„ κ°μ§€ν•˜λŠ” λ°”μ΄μ˜€μ„Όμ„œ λ‹¨λ°±μ§ˆμ„ μƒμ„±ν•΄μ£Όμ„Έμš”",
1154
+ "배터리 μ„±λŠ₯을 ν–₯μƒμ‹œν‚€λŠ” 전도성 λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1155
+ "κ·Ήν•œμ˜ κ³ μ˜¨μ—μ„œλ„ μ•ˆμ •ν•œ μ΄ˆλ‚΄μ—΄μ„± λ‹¨λ°±μ§ˆμ„ λ§Œλ“€μ–΄μ£Όμ„Έμš”",
1156
+ "생뢄해성 ν”ŒλΌμŠ€ν‹± 생산을 μœ„ν•œ μ€‘ν•©νš¨μ†Œλ₯Ό μ„€κ³„ν•΄μ£Όμ„Έμš”",
1157
+ "μ‹λ¬Όμ˜ 병해좩 저항성을 κ°•ν™”ν•˜λŠ” λ‹¨λ°±μ§ˆμ„ μƒμ„±ν•΄μ£Όμ„Έμš”",
1158
+ "과일의 μˆ™μ„±μ„ μ‘°μ ˆν•˜λŠ” λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1159
+ "λŒ€κΈ° μ˜€μ—Όλ¬Όμ§ˆμ„ μ‹€μ‹œκ°„ κ°μ§€ν•˜λŠ” λ‹¨λ°±μ§ˆμ„ λ§Œλ“€μ–΄μ£Όμ„Έμš”",
1160
+ "μ„μœ  μ˜€μ—Όμ„ λΆ„ν•΄ν•˜λŠ” ν•΄μ–‘ λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1161
+ "κ·Ήμ €μ˜¨μ—μ„œ ν™œμ„±μ„ μœ μ§€ν•˜λŠ” μ €μ˜¨ 적응 λ‹¨λ°±μ§ˆμ„ μƒμ„±ν•΄μ£Όμ„Έμš”",
1162
+ "κ³ μ•• ν™˜κ²½μ—μ„œ μ•ˆμ •ν•œ 심해 적응 λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1163
+ "κ°•ν•œ μ‚°μ„± ν™˜κ²½μ—μ„œ μž‘λ™ν•˜λŠ” λ‹¨λ°±μ§ˆμ„ λ§Œλ“€μ–΄μ£Όμ„Έμš”",
1164
+ "λ‚˜λ…Έ ꡬ쑰체λ₯Ό μžκ°€ μ‘°λ¦½ν•˜λŠ” λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”",
1165
+ "방사λŠ₯ λ¬Όμ§ˆμ„ μ•ˆμ „ν•˜κ²Œ λΆ„ν•΄ν•˜λŠ” λ‹¨λ°±μ§ˆμ„ μƒμ„±ν•΄μ£Όμ„Έμš”",
1166
+ "방사선에 저항성이 μžˆλŠ” 우주 ν™˜κ²½μš© λ‹¨λ°±μ§ˆμ„ μ„€κ³„ν•΄μ£Όμ„Έμš”"
1167
+ ]
1168
+
1169
+
1170
+
1171
+ with gr.Row():
1172
+ msg = gr.Textbox(
1173
+ label="λ©”μ‹œμ§€λ₯Ό μž…λ ₯ν•˜μ„Έμš”",
1174
+ placeholder="예: COVID-19λ₯Ό μΉ˜λ£Œν•  수 μžˆλŠ” λ‹¨λ°±μ§ˆμ„ μƒμ„±ν•΄μ£Όμ„Έμš”",
1175
+ lines=2,
1176
+ scale=4
1177
+ )
1178
+ submit_btn = gr.Button("전솑", variant="primary", scale=1)
1179
+
1180
+ clear = gr.Button("λŒ€ν™” λ‚΄μš© μ§€μš°κΈ°")
1181
+
1182
+ # 예제 선택 μ‹œ μž…λ ₯창에 μžλ™ μž…λ ₯
1183
+ def use_example(example):
1184
+ return example
1185
+
1186
+ use_example_btn.click(
1187
+ fn=use_example,
1188
+ inputs=[example_dropdown],
1189
+ outputs=[msg]
1190
+ )
1191
 
1192
 
1193