Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No special tokens for LLaMA 1 in conversion script #32340

Closed
4 tasks
ViktorooReps opened this issue Jul 30, 2024 · 2 comments
Closed
4 tasks

No special tokens for LLaMA 1 in conversion script #32340

ViktorooReps opened this issue Jul 30, 2024 · 2 comments

Comments

@ViktorooReps
Copy link
Contributor

System Info

Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.

  • transformers version: 4.43.3
  • Platform: Linux-5.15.0-116-generic-x86_64-with-glibc2.35
  • Python version: 3.12.4
  • Huggingface_hub version: 0.24.3
  • Safetensors version: 0.4.3
  • Accelerate version: 0.33.0
  • Accelerate config: - compute_environment: LOCAL_MACHINE
    - distributed_type: NO
    - mixed_precision: bf16
    - use_cpu: False
    - debug: False
    - num_processes: 1
    - machine_rank: 0
    - num_machines: 1
    - gpu_ids: all
    - rdzv_backend: static
    - same_network: True
    - main_training_function: main
    - enable_cpu_affinity: False
    - downcast_bf16: no
    - tpu_use_cluster: False
    - tpu_use_sudo: False
    - tpu_env: []
  • PyTorch version (GPU?): 2.4.0+cu121 (True)
  • Tensorflow version (GPU?): not installed (NA)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using distributed or parallel set-up in script?:NO
  • Using GPU in script?: NO
  • GPU type: Tesla V100-SXM2-32GB

Who can help?

@ArthurZucker

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

  1. Download original weights to llama-tokenizer/7B
  2. Run:
✗ python ../venv/lib/python3.12/site-packages/transformers/models/llama/convert_llama_weights_to_hf.py --input_dir llama-tokenizer/7B --output_dir llama7b --model_size 7B
Traceback (most recent call last):
  File "/mloscratch/homes/shcherba/landmark-attention/llama/../venv/lib/python3.12/site-packages/transformers/models/llama/convert_llama_weights_to_hf.py", line 478, in <module>
    main()
  File "/mloscratch/homes/shcherba/landmark-attention/llama/../venv/lib/python3.12/site-packages/transformers/models/llama/convert_llama_weights_to_hf.py", line 452, in main
    args.special_tokens = DEFAULT_LLAMA_SPECIAL_TOKENS[str(args.llama_version)]
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '1'

Expected behavior

No errors, completed conversion, as described in https://huggingface.co/docs/transformers/en/model_doc/llama

@ArthurZucker
Copy link
Collaborator

Hey! Indeed, we can set the default to []. As this is only used for Llama3.
Would you like to open a PR for the fix? 🤗

@ViktorooReps
Copy link
Contributor Author

Sure, one moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants