MCPcopy Create free account
hub / github.com/allenai/molmo2 / get_spec

Method get_spec

olmo/preprocessing/preprocessor_utils.py:74–80  ·  view source on GitHub ↗
(cls, src: TokenizedVisionData)

Source from the content-addressed store, hash-verified

72
73 @classmethod
74 def get_spec(cls, src: TokenizedVisionData) -> Dict[str, 'TensorSpec']:
75 spec = {} if src.other_data is None else src.other_data
76 for k in ["tokens", "images", "image_masks", "token_pooling", "low_res_token_pooling"]:
77 v = getattr(src, k)
78 if v is not None:
79 spec[k] = TensorSpec.build(getattr(src, k))
80 return spec
81
82 @staticmethod
83 def max(*other: 'TensorSpec'):

Callers 2

get_output_shapesMethod · 0.80
get_output_shapesMethod · 0.80

Calls 1

buildMethod · 0.45

Tested by

no test coverage detected