Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -62,11 +62,11 @@ def get_image_description(image):
|
|
62 |
gc.collect()
|
63 |
|
64 |
prompt = "[INST] <image>\nDescribe the image in a sentence [/INST]"
|
65 |
-
n = len(prompt)
|
66 |
|
67 |
inputs = processor(prompt, image, return_tensors="pt").to("cuda:0")
|
68 |
output = vision_model.generate(**inputs, max_new_tokens=100)
|
69 |
-
return (processor.decode(output[0]
|
70 |
|
71 |
|
72 |
CSS = """
|
|
|
62 |
gc.collect()
|
63 |
|
64 |
prompt = "[INST] <image>\nDescribe the image in a sentence [/INST]"
|
65 |
+
# n = len(prompt)
|
66 |
|
67 |
inputs = processor(prompt, image, return_tensors="pt").to("cuda:0")
|
68 |
output = vision_model.generate(**inputs, max_new_tokens=100)
|
69 |
+
return (processor.decode(output[0], skip_special_tokens=True))
|
70 |
|
71 |
|
72 |
CSS = """
|