lichengen commited on
Commit
ca4bd3b
·
1 Parent(s): 8d1c3e1

fix API key error

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -52,10 +52,21 @@ with gr.Blocks() as demo:
52
  """
53
  # 文章彙整工具
54
  輸入希望快速吸收資訊來源,即可使用問答的方式獲取資訊!
 
 
55
  """
56
  )
 
 
 
 
 
 
 
 
 
57
  with gr.Tab("Articles"):
58
- gr.Markdown("請在下列文字匡中輸入待彙整的資訊")
59
  input1 = gr.Textbox(label="Articles 1")
60
  input2 = gr.Textbox(label="Articles 2")
61
  input3 = gr.Textbox(label="Articles 3")
@@ -71,15 +82,6 @@ with gr.Blocks() as demo:
71
  text_button.click(fn=create_embedding, inputs=[input1, input2, input3, input4, input5, input6, input7, input8, input9, input10], outputs=output_text, api_name="create_embedding")
72
 
73
  with gr.Tab("Chatbot"):
74
- openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key (sk-...) and hit Enter",
75
- show_label=False, lines=1, type='password')
76
- openai_api_key_textbox.change(set_openai_api_key,
77
- inputs=[openai_api_key_textbox],
78
- outputs=[])
79
- openai_api_key_textbox.submit(set_openai_api_key,
80
- inputs=[openai_api_key_textbox],
81
- outputs=[])
82
-
83
  def predict(message, history):
84
  bot_message = Bot(prompt = message)
85
 
 
52
  """
53
  # 文章彙整工具
54
  輸入希望快速吸收資訊來源,即可使用問答的方式獲取資訊!
55
+
56
+ 請輸入 Open AI API key 以使用本服務
57
  """
58
  )
59
+ openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key (sk-...) and hit Enter",
60
+ show_label=False, lines=1, type='password')
61
+ openai_api_key_textbox.change(set_openai_api_key,
62
+ inputs=[openai_api_key_textbox],
63
+ outputs=[])
64
+ openai_api_key_textbox.submit(set_openai_api_key,
65
+ inputs=[openai_api_key_textbox],
66
+ outputs=[])
67
+
68
  with gr.Tab("Articles"):
69
+ gr.Markdown("請在下列文字匡中輸入待彙整的文章")
70
  input1 = gr.Textbox(label="Articles 1")
71
  input2 = gr.Textbox(label="Articles 2")
72
  input3 = gr.Textbox(label="Articles 3")
 
82
  text_button.click(fn=create_embedding, inputs=[input1, input2, input3, input4, input5, input6, input7, input8, input9, input10], outputs=output_text, api_name="create_embedding")
83
 
84
  with gr.Tab("Chatbot"):
 
 
 
 
 
 
 
 
 
85
  def predict(message, history):
86
  bot_message = Bot(prompt = message)
87