thwri commited on
Commit
5056b2f
·
verified ·
1 Parent(s): 083d1e0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -3
README.md CHANGED
@@ -47,8 +47,8 @@ model = AutoModelForCausalLM.from_pretrained("thwri/CogFlorence-2-Large-Freeze",
47
  processor = AutoProcessor.from_pretrained("thwri/CogFlorence-2-Large-Freeze", trust_remote_code=True)
48
 
49
  # Function to run the model on an example
50
- def run_example(task_prompt, text_input, image):
51
- prompt = task_prompt + text_input
52
 
53
  # Ensure the image is in RGB mode
54
  if image.mode != "RGB":
@@ -72,7 +72,8 @@ import copy
72
 
73
  url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
74
  image = Image.open(requests.get(url, stream=True).raw)
75
- run_example("<MORE_DETAILED_CAPTION>", "Describe this image in great detail.", image)
 
76
 
77
  # {'<MORE_DETAILED_CAPTION>': 'a turquoise volkswagen beetle parked on a cobblestone street in front of a yellow wall with two wooden doors. the car's body is painted in a vibrant shade of teal, with a glossy finish that reflects the sunlight, and the wheels are polished with a silver hubcap. the building behind the car has a weathered, aged appearance, with visible cracks and peeling paint. the sky above is clear and blue, suggesting a sunny day.'}
78
  ```
 
47
  processor = AutoProcessor.from_pretrained("thwri/CogFlorence-2-Large-Freeze", trust_remote_code=True)
48
 
49
  # Function to run the model on an example
50
+ def run_example(task_prompt, image):
51
+ prompt = task_prompt
52
 
53
  # Ensure the image is in RGB mode
54
  if image.mode != "RGB":
 
72
 
73
  url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
74
  image = Image.open(requests.get(url, stream=True).raw)
75
+ result = run_example("<MORE_DETAILED_CAPTION>" , image)
76
+ print(result)
77
 
78
  # {'<MORE_DETAILED_CAPTION>': 'a turquoise volkswagen beetle parked on a cobblestone street in front of a yellow wall with two wooden doors. the car's body is painted in a vibrant shade of teal, with a glossy finish that reflects the sunlight, and the wheels are polished with a silver hubcap. the building behind the car has a weathered, aged appearance, with visible cracks and peeling paint. the sky above is clear and blue, suggesting a sunny day.'}
79
  ```