add grounding example
Browse files
README.md
CHANGED
@@ -85,7 +85,10 @@ processor = AutoProcessor.from_pretrained("microsoft/Florence-2-base-ft", trust_
|
|
85 |
url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
|
86 |
image = Image.open(requests.get(url, stream=True).raw)
|
87 |
|
88 |
-
def run_example(prompt):
|
|
|
|
|
|
|
89 |
|
90 |
inputs = processor(text=prompt, images=image, return_tensors="pt")
|
91 |
generated_ids = model.generate(
|
|
|
85 |
url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
|
86 |
image = Image.open(requests.get(url, stream=True).raw)
|
87 |
|
88 |
+
def run_example(prompt, text_input=None):
|
89 |
+
|
90 |
+
if text_input is not None:
|
91 |
+
prompt = prompt + text_input
|
92 |
|
93 |
inputs = processor(text=prompt, images=image, return_tensors="pt")
|
94 |
generated_ids = model.generate(
|