Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,6 @@ def inference(text, image):
|
|
21 |
prompt = prompt_format.format(text)
|
22 |
inputs = processor(prompt, image, return_tensors='pt').to(0, torch.float16)
|
23 |
output = model.generate(**inputs, max_new_tokens=1024)
|
24 |
-
return processor.decode(output[0]
|
25 |
|
26 |
gr.Interface(fn=inference, inputs=[gr.Text(), gr.Image()], outputs=gr.Text()).launch()
|
|
|
21 |
prompt = prompt_format.format(text)
|
22 |
inputs = processor(prompt, image, return_tensors='pt').to(0, torch.float16)
|
23 |
output = model.generate(**inputs, max_new_tokens=1024)
|
24 |
+
return processor.decode(output[0], skip_special_tokens=True).split("ASSISTANT:")[-1]
|
25 |
|
26 |
gr.Interface(fn=inference, inputs=[gr.Text(), gr.Image()], outputs=gr.Text()).launch()
|