andito HF staff commited on
Commit
16aea32
·
verified ·
1 Parent(s): b9714c0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -68,6 +68,7 @@ processor = AutoProcessor.from_pretrained("HuggingFaceTB/SmolVLM-Instruct")
68
  model = AutoModelForVision2Seq.from_pretrained(
69
  "HuggingFaceTB/SmolVLM-Instruct",
70
  torch_dtype=torch.bfloat16,
 
71
  ).to(DEVICE)
72
 
73
  # Create input messages
@@ -97,10 +98,9 @@ generated_texts = processor.batch_decode(
97
  print(generated_texts[0])
98
  """
99
  Assistant: The first image shows a green statue of the Statue of Liberty standing on a stone pedestal in front of a body of water.
100
- The statue is holding a torch in its right hand and a tablet in its left hand.
101
- The water is calm and there are some trees and buildings in the background.
102
- The second image shows a bee on a pink flower.
103
- The bee is black and yellow and is surrounded by pink petals.
104
  """
105
  ```
106
 
 
68
  model = AutoModelForVision2Seq.from_pretrained(
69
  "HuggingFaceTB/SmolVLM-Instruct",
70
  torch_dtype=torch.bfloat16,
71
+ _attn_implementation="flash_attention_2" if DEVICE == "cuda" else "eager",
72
  ).to(DEVICE)
73
 
74
  # Create input messages
 
98
  print(generated_texts[0])
99
  """
100
  Assistant: The first image shows a green statue of the Statue of Liberty standing on a stone pedestal in front of a body of water.
101
+ The statue is holding a torch in its right hand and a tablet in its left hand. The water is calm and there are no boats or other objects visible.
102
+ The sky is clear and there are no clouds. The second image shows a bee on a pink flower.
103
+ The bee is black and yellow and is collecting pollen from the flower. The flower is surrounded by green leaves.
 
104
  """
105
  ```
106