Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ def ask_gpt(api_key, prompt):
|
|
9 |
)
|
10 |
return chat_completion.choices[0].message.content
|
11 |
|
12 |
-
api_key=gr.Textbox(label='輸入 OpenAI 金鑰')
|
13 |
prompt=gr.Textbox(label='您的詢問: ')
|
14 |
reply=gr.Textbox(label='OpenAI 回答: ')
|
15 |
iface=gr.Interface(
|
@@ -17,6 +17,6 @@ iface=gr.Interface(
|
|
17 |
inputs=[api_key, prompt],
|
18 |
outputs=reply,
|
19 |
title='OpenAI API 聊天機器人',
|
20 |
-
|
21 |
)
|
22 |
iface.launch()
|
|
|
9 |
)
|
10 |
return chat_completion.choices[0].message.content
|
11 |
|
12 |
+
api_key=gr.Textbox(label='輸入 OpenAI 金鑰', type='password')
|
13 |
prompt=gr.Textbox(label='您的詢問: ')
|
14 |
reply=gr.Textbox(label='OpenAI 回答: ')
|
15 |
iface=gr.Interface(
|
|
|
17 |
inputs=[api_key, prompt],
|
18 |
outputs=reply,
|
19 |
title='OpenAI API 聊天機器人',
|
20 |
+
flagging_mode='never',
|
21 |
)
|
22 |
iface.launch()
|