Update app.py
Browse files
app.py
CHANGED
@@ -62,4 +62,11 @@ with gr.Blocks() as demo:
|
|
62 |
submit_btn.click(fn=compute_rewards, inputs=[problem_input, response_input], outputs=output)
|
63 |
|
64 |
if __name__ == "__main__":
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
submit_btn.click(fn=compute_rewards, inputs=[problem_input, response_input], outputs=output)
|
63 |
|
64 |
if __name__ == "__main__":
|
65 |
+
# 修改launch参数,启用API
|
66 |
+
demo.launch(
|
67 |
+
server_name="0.0.0.0",
|
68 |
+
server_port=7860,
|
69 |
+
share=True,# 允许生成公共URL
|
70 |
+
enable_queue=True, # 启用队列
|
71 |
+
api_name="/predict" # 指定API端点名称
|
72 |
+
)
|