Spaces:
Sleeping
Sleeping
better gpu
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ model.to(device)
|
|
14 |
def output_generate(image):
|
15 |
im = transform(image).unsqueeze(0).to(device)
|
16 |
generated = model.generate(im, seq_len=20)
|
17 |
-
return open_clip.decode(generated[0]).split("<end_of_text>")[0].replace("<start_of_text>", "")
|
18 |
|
19 |
iface = gr.Interface(fn=output_generate, inputs=gr.Image(type="pil"), outputs="text")
|
20 |
iface.launch()
|
|
|
14 |
def output_generate(image):
|
15 |
im = transform(image).unsqueeze(0).to(device)
|
16 |
generated = model.generate(im, seq_len=20)
|
17 |
+
return open_clip.decode(generated[0].detach()).split("<end_of_text>")[0].replace("<start_of_text>", "")
|
18 |
|
19 |
iface = gr.Interface(fn=output_generate, inputs=gr.Image(type="pil"), outputs="text")
|
20 |
iface.launch()
|