Closed sadra-barikbin closed 4 weeks ago
Besides, in v2.1.1, OPT's embedding is loaded using prefix
which raises this error:
File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/opt.py", line 62, in __init__
model = OPTForCausalLM(config, weights)
File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/custom_modeling/opt_modeling.py", line 749, in __init__
self.model = OPTModel(config, weights)
File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/custom_modeling/opt_modeling.py", line 691, in __init__
self.decoder = OPTDecoder(config, weights)
File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/custom_modeling/opt_modeling.py", line 440, in __init__
self.embed_tokens = TensorParallelEmbedding(
File "/opt/conda/lib/python3.10/site-packages/text_generation_server/layers/tensor_parallel.py", line 230, in __init__
weight = weights.get_partial_sharded(f"{prefix}.weight", dim=0)
File "/opt/conda/lib/python3.10/site-packages/text_generation_server/utils/weights.py", line 89, in get_partial_sharded
filename, tensor_name = self.get_filename(tensor_name)
File "/opt/conda/lib/python3.10/site-packages/text_generation_server/utils/weights.py", line 64, in get_filename
raise RuntimeError(f"weight {tensor_name} does not exist")
RuntimeError: weight model.decoder.embed_tokens.weight does not exist
With the latest changes on the main, It seems still it would raise error as CausalLM
sets prefix to ""
in
and prefix becomes "model.decoder.embed_tokens"
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Hi. This issue still persists. The OPT models in the hub do not have a 'model'
at the beginning of their weights' names. This causes error when loading OPT which sets the prefix to 'model'
. @danieldk
Fixed by #2371
Hi there!
OPTForCausalLM
doesn't giveprefix
toOPTModel
inopt_modelling.py
while it's a positional argument to it.https://github.com/huggingface/text-generation-inference/blob/05c094fcfae4d869e12910f637b4dc9d7a9e0421/server/text_generation_server/models/custom_modeling/opt_modeling.py#L751-L764
https://github.com/huggingface/text-generation-inference/blob/05c094fcfae4d869e12910f637b4dc9d7a9e0421/server/text_generation_server/models/custom_modeling/opt_modeling.py#L694-L698