Spaces:
Runtime error
Runtime error
Commit
·
25f6458
1
Parent(s):
9e79a2c
Update app.py
Browse files
app.py
CHANGED
@@ -15,11 +15,6 @@ def predict(image,max_length=50,device='cpu'):
|
|
15 |
pixel_values = processor(images=image, return_tensors="pt").to(device).pixel_values
|
16 |
generated_ids = model.generate(pixel_values=pixel_values, max_length=max_length)
|
17 |
generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
18 |
-
# relation = get_relation(generated_caption)
|
19 |
-
|
20 |
-
# entity_pair = get_entities(generated_caption)
|
21 |
-
|
22 |
-
# knowlege_triplet = f"'{entity_pair[0]}'---{relation}--->'{entity_pair[1]}'"
|
23 |
|
24 |
return generated_caption
|
25 |
|
|
|
15 |
pixel_values = processor(images=image, return_tensors="pt").to(device).pixel_values
|
16 |
generated_ids = model.generate(pixel_values=pixel_values, max_length=max_length)
|
17 |
generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
return generated_caption
|
20 |
|