Spaces:
Running
Running
Update bin_public/app/app.py
Browse files- bin_public/app/app.py +29 -0
bin_public/app/app.py
CHANGED
@@ -147,6 +147,18 @@ with gr.Blocks(css=customCSS) as demo:
|
|
147 |
with gr.Column():
|
148 |
downloadFile = gr.File(interactive=True)
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
gr.HTML("""
|
151 |
<div style="text-align: center; margin-top: 20px; margin-bottom: 20px;">
|
152 |
""")
|
@@ -239,6 +251,23 @@ with gr.Blocks(css=customCSS) as demo:
|
|
239 |
templateSelectDropdown.change(get_template_content, [promptTemplates, templateSelectDropdown, systemPromptTxt],
|
240 |
[systemPromptTxt], show_progress=True)
|
241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
logging.info( "\n访问 http://localhost:7860 查看界面")
|
243 |
# 默认开启本地服务器,默认可以直接从IP访问,默认不创建公开分享链接
|
244 |
demo.title = "ChatGPT-长江商学院 🚀"
|
|
|
147 |
with gr.Column():
|
148 |
downloadFile = gr.File(interactive=True)
|
149 |
|
150 |
+
with gr.Tab(label="Davinci-003"):
|
151 |
+
with gr.Column():
|
152 |
+
with gr.Row():
|
153 |
+
with gr.Column():
|
154 |
+
davinci_user_input = gr.Textbox(show_label=False, placeholder="在这里输入").style(
|
155 |
+
container=False)
|
156 |
+
temperature_davinci = gr.Slider(minimum=-0, maximum=1.0, value=0.7,
|
157 |
+
step=0.1, interactive=True, label="Temperature", )
|
158 |
+
davinci_submitBtn = gr.Button("🚀", variant="primary")
|
159 |
+
davinci_output = gr.Textbox(show_label=False, placeholder="output").style(
|
160 |
+
container=False)
|
161 |
+
|
162 |
gr.HTML("""
|
163 |
<div style="text-align: center; margin-top: 20px; margin-bottom: 20px;">
|
164 |
""")
|
|
|
251 |
templateSelectDropdown.change(get_template_content, [promptTemplates, templateSelectDropdown, systemPromptTxt],
|
252 |
[systemPromptTxt], show_progress=True)
|
253 |
|
254 |
+
# Davinci
|
255 |
+
davinci_user_input.submit(predict_davinci,
|
256 |
+
[
|
257 |
+
keyTxt,
|
258 |
+
davinci_user_input,
|
259 |
+
temperature,
|
260 |
+
],
|
261 |
+
[davinci_output], show_progress=True)
|
262 |
+
|
263 |
+
davinci_submitBtn.click(predict_davinci,
|
264 |
+
[
|
265 |
+
keyTxt,
|
266 |
+
davinci_user_input,
|
267 |
+
temperature_davinci,
|
268 |
+
],
|
269 |
+
[davinci_output], show_progress=True)
|
270 |
+
|
271 |
logging.info( "\n访问 http://localhost:7860 查看界面")
|
272 |
# 默认开启本地服务器,默认可以直接从IP访问,默认不创建公开分享链接
|
273 |
demo.title = "ChatGPT-长江商学院 🚀"
|