Spaces:
Runtime error
Runtime error
zxsipola123456
commited on
Commit
•
c893e59
1
Parent(s):
1c4e859
Update app.py
Browse files
app.py
CHANGED
@@ -87,7 +87,7 @@ base_url_options=["https://lmzh.top/v1","https://api.openai.com/v1"]
|
|
87 |
model_options = ["gpt-3.5-turbo", "gpt-4o-mini", "gpt-4o", "gpt-4o-2024-08-06"]
|
88 |
|
89 |
def clear_output():
|
90 |
-
return "",""
|
91 |
|
92 |
def validate_tran_api_key(api_key):
|
93 |
if api_key == '':
|
@@ -155,7 +155,7 @@ with app:
|
|
155 |
<div class="header">
|
156 |
<div class="header-title">API-KEY验证</div>
|
157 |
<div class="header-subtitle">
|
158 |
-
|
159 |
</div>
|
160 |
</div>
|
161 |
''')
|
@@ -194,7 +194,7 @@ with app:
|
|
194 |
output_textbox = gr.Textbox(label="显示问题答案", lines=12, max_lines=12, elem_classes="custom-textbox",interactive=True,show_label=True,show_copy_button=True)
|
195 |
output_textbox2 = gr.Textbox(label="显示tokens数", lines=1, max_lines=1, elem_classes="custom-textbox",interactive=False,show_label=True)
|
196 |
message_btn.click(generate_response,inputs=[question,model_name,endpoint,transmit_api_key, official_api_key],outputs=output_textbox,show_progress=False)
|
197 |
-
clear_btn.click(clear_output,outputs=[question,output_textbox],show_progress=False)
|
198 |
output_textbox.change(fn=calculate_cost_and_tokens,inputs=[output_textbox,model_name],outputs=output_textbox2,show_progress=False)
|
199 |
#添加页面底部
|
200 |
gr.HTML('''
|
|
|
87 |
model_options = ["gpt-3.5-turbo", "gpt-4o-mini", "gpt-4o", "gpt-4o-2024-08-06"]
|
88 |
|
89 |
def clear_output():
|
90 |
+
return "","",""
|
91 |
|
92 |
def validate_tran_api_key(api_key):
|
93 |
if api_key == '':
|
|
|
155 |
<div class="header">
|
156 |
<div class="header-title">API-KEY验证</div>
|
157 |
<div class="header-subtitle">
|
158 |
+
key购买地址 <a href="https://buy.sipola.cn" target="_blank">here</a>,超强ai工具请访问 <a href="https://ai.sipola.cn" target="_blank">here</a>
|
159 |
</div>
|
160 |
</div>
|
161 |
''')
|
|
|
194 |
output_textbox = gr.Textbox(label="显示问题答案", lines=12, max_lines=12, elem_classes="custom-textbox",interactive=True,show_label=True,show_copy_button=True)
|
195 |
output_textbox2 = gr.Textbox(label="显示tokens数", lines=1, max_lines=1, elem_classes="custom-textbox",interactive=False,show_label=True)
|
196 |
message_btn.click(generate_response,inputs=[question,model_name,endpoint,transmit_api_key, official_api_key],outputs=output_textbox,show_progress=False)
|
197 |
+
clear_btn.click(clear_output,outputs=[question,output_textbox,output_textbox2],show_progress=False)
|
198 |
output_textbox.change(fn=calculate_cost_and_tokens,inputs=[output_textbox,model_name],outputs=output_textbox2,show_progress=False)
|
199 |
#添加页面底部
|
200 |
gr.HTML('''
|