lihongze8 commited on
Commit
d41d753
·
verified ·
1 Parent(s): 2ce9270

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
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
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
 
 
 
 
 
 
 
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
+ )