leewatson commited on
Commit
f810d4e
·
verified ·
1 Parent(s): d2f3943

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -34,7 +34,11 @@ with gr.Blocks() as demo:
34
  img = gr.Markdown()
35
  struct = gr.Textbox(label="디버그/구조 데이터", lines=10)
36
 
 
37
  btn.click(run_pipeline, inputs=[text, alpha, z, steps], outputs=[report, img, struct], api_name="predict")
38
 
 
 
39
  if __name__ == "__main__":
40
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
 
34
  img = gr.Markdown()
35
  struct = gr.Textbox(label="디버그/구조 데이터", lines=10)
36
 
37
+ # api_name="predict" 로 REST 경로 노출
38
  btn.click(run_pipeline, inputs=[text, alpha, z, steps], outputs=[report, img, struct], api_name="predict")
39
 
40
+ # ★ Queue를 명시적으로 켭니다(Gradio 서버가 큐 기반이면 gradio_client가 훨씬 안정적).
41
+ # launch 직전 queue()를 반드시 호출.
42
  if __name__ == "__main__":
43
+ demo.queue(concurrency_count=1, max_size=128)
44
+ demo.launch(server_name="0.0.0.0", server_port=7860, show_error=True)