MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / max_length

Method max_length

test/general/utils_eval.py:37–56  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35
36 @property
37 def max_length(self):
38 if self._max_length != -1:
39 return self._max_length
40 if hasattr(self.model.config, 'n_ctx'):
41 return self.model.config.n_ctx
42 elif hasattr(self.model.config, 'max_position_embeddings'):
43 return self.model.config.max_position_embeddings
44 elif hasattr(self.model.config, 'n_positions'):
45 return self.model.config.n_positions
46 elif 'bloom' in self.model_name:
47 return 2048
48 elif 'llama' in self.model_name:
49 return 2048 # TODO: did not check this
50 elif 'mpt' in self.model_name:
51 return 2048
52 elif 'falcon' in self.model_name:
53 return 2048
54 else:
55 print(self.model.config)
56 raise NotImplementedError
57
58 @property
59 def max_gen_toks(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected