tony1966 commited on
Commit
97995d8
·
verified ·
1 Parent(s): c20b058

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- allow_flagging='never',
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()