yiyueyiming commited on
Commit
6318809
·
1 Parent(s): 7a6db1f

在 launch 方法中添加 share=True 参数, Gradio 会自动创建一个临时的公共 URL

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -4,5 +4,6 @@ import cv2
4
  def to_black(image):
5
  output = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
6
  return output
 
7
  interface = gr.Interface(fn=to_black, inputs="image", outputs="image")
8
- interface.launch(server_name='127.0.0.1',server_port=7788)
 
4
  def to_black(image):
5
  output = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
6
  return output
7
+
8
  interface = gr.Interface(fn=to_black, inputs="image", outputs="image")
9
+ interface.launch(share=True)