zxsipola123456 commited on
Commit
c742a39
·
verified ·
1 Parent(s): 6296bf6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -116,7 +116,7 @@ def validate_offi_api_key(api_key):
116
  # return official_api_key if official_api_key else "请填写您的官方API Key"
117
 
118
  # Gradio 前端设计
119
- app = gr.Blocks(css="style.css")
120
 
121
  with app:
122
  gr.HTML('''
@@ -131,20 +131,24 @@ with app:
131
  with gr.Row(variant='panel'):
132
  with gr.Column():
133
  transmit_api_key = gr.Textbox(type='password', label='中转API-Key', placeholder='请在此填写您的中转API Key', elem_classes="custom-textbox")
134
- transmit_btn_text = gr.Button("点击验证中转key", variant="primary", elem_classes="custom-button")
 
 
135
 
136
  with gr.Column():
137
  transmit_output_textbox = gr.Textbox(label="显示key状态及可访问的模型列表", lines=5,max_lines=5, elem_classes="custom-textbox")
138
  transmit_btn_text.click(validate_tran_api_key,transmit_api_key,transmit_output_textbox)
139
-
140
  with gr.Row(variant='panel'):
141
  with gr.Column():
142
  official_api_key = gr.Textbox(type='password', label='官方API Key', placeholder='请在此输入你的官方API Key', elem_classes="custom-textbox")
143
- official_btn_text = gr.Button("点击验证官方key", variant="primary", elem_classes="custom-button")
144
-
 
145
  with gr.Column():
146
  official_output_textbox = gr.Textbox(label="显示key状态及可访问的模型列表", lines=5, max_lines=5, elem_classes="custom-textbox" )
147
  official_btn_text.click(validate_offi_api_key, official_api_key, official_output_textbox)
 
148
  with gr.Row(variant='panel'):
149
  with gr.Column():
150
  question=gr.Textbox(label="请输入你的问题: ",lines=2,max_lines=3)
 
116
  # return official_api_key if official_api_key else "请填写您的官方API Key"
117
 
118
  # Gradio 前端设计
119
+ app = gr.Blocks(css="style.css",title="sipole_verify_key")
120
 
121
  with app:
122
  gr.HTML('''
 
131
  with gr.Row(variant='panel'):
132
  with gr.Column():
133
  transmit_api_key = gr.Textbox(type='password', label='中转API-Key', placeholder='请在此填写您的中转API Key', elem_classes="custom-textbox")
134
+ with gr.Row(variant='panel')
135
+ transmit_btn_text = gr.Button("点击验证中转key", variant="primary", elem_classes="custom-button")
136
+ clear_btn = gr.Button("清除", variant="primary", elem_classes="custom-button")
137
 
138
  with gr.Column():
139
  transmit_output_textbox = gr.Textbox(label="显示key状态及可访问的模型列表", lines=5,max_lines=5, elem_classes="custom-textbox")
140
  transmit_btn_text.click(validate_tran_api_key,transmit_api_key,transmit_output_textbox)
141
+ clear_btn.click(clear_output,outputs=[transmit_api_key,transmit_output_textbox],show_progress=False)
142
  with gr.Row(variant='panel'):
143
  with gr.Column():
144
  official_api_key = gr.Textbox(type='password', label='官方API Key', placeholder='请在此输入你的官方API Key', elem_classes="custom-textbox")
145
+ with gr.Row(variant='panel')
146
+ official_btn_text = gr.Button("点击验证官方key", variant="primary", elem_classes="custom-button")
147
+ clear_btn = gr.Button("清除", variant="primary", elem_classes="custom-button")
148
  with gr.Column():
149
  official_output_textbox = gr.Textbox(label="显示key状态及可访问的模型列表", lines=5, max_lines=5, elem_classes="custom-textbox" )
150
  official_btn_text.click(validate_offi_api_key, official_api_key, official_output_textbox)
151
+ clear_btn.click(clear_output,outputs=[official_api_key,official_output_textbox],show_progress=False)
152
  with gr.Row(variant='panel'):
153
  with gr.Column():
154
  question=gr.Textbox(label="请输入你的问题: ",lines=2,max_lines=3)