crrrr30 commited on
Commit
8a896a8
1 Parent(s): 1bbccb3

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. demo.py +7 -4
demo.py CHANGED
@@ -138,7 +138,10 @@ with gr.Blocks(theme=gr.themes.Monochrome(font=[gr.themes.GoogleFont("DM Sans"),
138
  with gr.Row():
139
  gr.Examples([f"{base}/{idx}.png" for idx in indices], inputs=input_image, outputs=[softmax, grad_cam], fn=predict, run_on_click=True)
140
 
141
- demo.launch(
142
- share=False, debug=False, allowed_paths=[f"{base}"], server_name="0.0.0.0", # ssl_verify=False,
143
- server_port=8000, # ssl_certfile="/workspace/openssl/cert.pem", ssl_keyfile="/workspace/openssl/key.pem"
144
- )
 
 
 
 
138
  with gr.Row():
139
  gr.Examples([f"{base}/{idx}.png" for idx in indices], inputs=input_image, outputs=[softmax, grad_cam], fn=predict, run_on_click=True)
140
 
141
+ if args.local:
142
+ demo.launch(
143
+ share=False, debug=False, allowed_paths=[f"{base}"], server_name="0.0.0.0", # ssl_verify=False,
144
+ server_port=8000, # ssl_certfile="/workspace/openssl/cert.pem", ssl_keyfile="/workspace/openssl/key.pem"
145
+ )
146
+ else:
147
+ demo.launch(allowed_paths=[f"{base}"])