Spaces:
Sleeping
Sleeping
fix
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ model, _, transform = open_clip.create_model_and_transforms(
|
|
10 |
def output_generate(image):
|
11 |
im = transform(image).unsqueeze(0)
|
12 |
generated = model.generate(im)
|
13 |
-
return open_clip.decode(generated).split("<end_of_text>")[0].replace("<start_of_text>", "")
|
14 |
|
15 |
-
iface = gr.Interface(fn=output_generate, inputs=gr.
|
16 |
iface.launch()
|
|
|
10 |
def output_generate(image):
|
11 |
im = transform(image).unsqueeze(0)
|
12 |
generated = model.generate(im)
|
13 |
+
return open_clip.decode(generated[0]).split("<end_of_text>")[0].replace("<start_of_text>", "")
|
14 |
|
15 |
+
iface = gr.Interface(fn=output_generate, inputs=gr.Ifimage(type="pil"), outputs="text")
|
16 |
iface.launch()
|