Pawel_Mar commited on
Commit
4e05e43
·
2 Parent(s): 243972f b163a45

Merge branch 'main' of hf.co:spaces/PawelMar/LettuceSegmentAPI into add_model

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,7 +1,12 @@
1
  import gradio as gr
 
 
2
 
3
  def greet(name):
4
  return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
7
  iface.launch()
 
1
  import gradio as gr
2
+ from transformers import AutoModel
3
+
4
 
5
  def greet(name):
6
  return "Hello " + name + "!!"
7
 
8
+ model = AutoModel.from_pretrained("models/last.pt")
9
+ pipe = pipeline("image-segmentation", model = model)
10
+ iface = gr.Interface.from_pipeline(pipe)
11
+ # iface = gr.Interface(fn=greet, inputs="text", outputs="text")
12
  iface.launch()