haipingwu commited on
Commit
6060dcc
1 Parent(s): b9f04dd

add grounding example

Browse files
Files changed (1) hide show
  1. README.md +4 -1
README.md CHANGED
@@ -85,7 +85,10 @@ processor = AutoProcessor.from_pretrained("microsoft/Florence-2-base", trust_rem
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(