mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-04 13:20:12 +06:00
fix(attention_visualizer): add default value for image_seq_length (#38577)
This commit is contained in:
parent
1dc619e59f
commit
82fa68ca14
@ -178,6 +178,7 @@ class AttentionMaskVisualizer:
|
|||||||
def visualize_attention_mask(self, input_sentence: str, suffix=""):
|
def visualize_attention_mask(self, input_sentence: str, suffix=""):
|
||||||
model = self.model
|
model = self.model
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
|
image_seq_length = None
|
||||||
if self.config.model_type in PROCESSOR_MAPPING_NAMES:
|
if self.config.model_type in PROCESSOR_MAPPING_NAMES:
|
||||||
img = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/bee.jpg?download=true"
|
img = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/bee.jpg?download=true"
|
||||||
img = Image.open(requests.get(img, stream=True).raw)
|
img = Image.open(requests.get(img, stream=True).raw)
|
||||||
|
Loading…
Reference in New Issue
Block a user