pytorch-labs / gpt-fast

Simple and efficient pytorch-native transformer text generation in <1000 LOC of python.
BSD 3-Clause "New" or "Revised" License
5.35k stars 484 forks source link

index out of range: No transformer config could be loaded #126

Open SinanAkkoyun opened 3 months ago

SinanAkkoyun commented 3 months ago

Hi! I tried to convert princeton-nlp/Sheared-LLaMA-1.3B-ShareGPT but it failed:

❯ ./scripts/prepare.sh $MODEL_REPO                                                                                                          (gptfast) 
README.md: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 1.37k/1.37k [00:00<00:00, 32.1MB/s]
added_tokens.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████| 21.0/21.0 [00:00<00:00, 173kB/s]
config.json: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 750/750 [00:00<00:00, 3.68MB/s]
generation_config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████| 132/132 [00:00<00:00, 618kB/s]
.gitattributes: 100%|████████████████████████████████████████████████████████████████████████████████████████████| 1.52k/1.52k [00:00<00:00, 7.59MB/s]
special_tokens_map.json: 100%|███████████████████████████████████████████████████████████████████████████████████████| 435/435 [00:00<00:00, 2.29MB/s]
trainer_state.json: 100%|████████████████████████████████████████████████████████████████████████████████████████| 2.59k/2.59k [00:00<00:00, 13.1MB/s]
test/temp0.0_num1.json: 100%|████████████████████████████████████████████████████████████████████████████████████| 1.80M/1.80M [00:00<00:00, 5.52MB/s]
tokenizer_config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████| 726/726 [00:00<00:00, 2.07MB/s]
training_args.bin: 100%|█████████████████████████████████████████████████████████████████████████████████████████| 4.03k/4.03k [00:00<00:00, 20.9MB/s]
tokenizer.model: 100%|█████████████████████████████████████████████████████████████████████████████████████████████| 500k/500k [00:00<00:00, 1.80MB/s]
pytorch_model.bin: 100%|█████████████████████████████████████████████████████████████████████████████████████████| 5.38G/5.38G [02:19<00:00, 38.6MB/s]
Fetching 12 files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [02:20<00:00, 11.67s/it]
Traceback (most recent call last):██████████████████████████████████████████████████████████████████████████████▉| 5.38G/5.38G [02:19<00:00, 43.2MB/s]
  File "/home/ai/ml/llm/inference/gpt-fast/scripts/convert_hf_checkpoint.py", line 105, in <module>
    convert_hf_checkpoint(
  File "/home/ai/.mconda3/envs/gptfast/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ai/ml/llm/inference/gpt-fast/scripts/convert_hf_checkpoint.py", line 30, in convert_hf_checkpoint
    config = ModelArgs.from_name(model_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ai/ml/llm/inference/gpt-fast/model.py", line 55, in from_name
    return cls(**transformer_configs[config[0]])
                                     ~~~~~~^^^
IndexError: list index out of range
kaizizzzzzz commented 3 months ago

The model.py file doesn't have the model parameter for this. You could search the parameter for this model and add it manually.