How to run nvidia/Llama-3.1-Nemotron-70B-Instruct-HF
- User
How to run nvidia/Llama-3.1-Nemotron-70B-Instruct-HF
- Assistant
- User
The tokenizer class you load from this checkpoint is not the same type as the class this function is called from. It may result in unexpected tokenization. The tokenizer class you load from this checkpoint is 'PreTrainedTokenizerFast'. The class this function is called from is 'LlamaTokenizer'. You are using the default legacy behaviour of the <class 'transformers.models.llama.tokenization_llama.LlamaTokenizer'>. This is expected, and simply means that the
legacy(previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set . This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in - if you loaded a llama tokenizer from a GGUF file you can ignore this message Traceback (most recent call last): File "/maahr/home/ameen/Chatbot/nemo/s.py", line 4, in tokenizer = LlamaTokenizer.from_pretrained(model_name) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2213, in from_pretrained return cls._from_pretrained( File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2447, in _from_pretrained tokenizer = cls(*init_inputs, **init_kwargs) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/transformers/models/llama/tokenization_llama.py", line 169, in self.sp_model = self.get_spm_processor(kwargs.pop("from_slow", False)) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/transformers/models/llama/tokenization_llama.py", line 196, in get_spm_processor tokenizer.Load(self.vocab_file) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/sentencepiece/.py", line 961, in Load return self.LoadFromFile(model_file) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/sentencepiece/.py", line 316, in LoadFromFile return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg) TypeError: not a string - Assistant
The error you're encountering relates to an issue with mismatched tokenizer classes when loading the model. The
LlamaTokenizeris being used incorrectly, as the checkpoint actually contains a . Here’s how you can resolve this problem: - User
Some parameters are on the meta device because they were offloaded to the cpu.
- Assistant
- User
Traceback (most recent call last): File "/maahr/home/ameen/Chatbot/nemo/s.py", line 12, in model = accelerator.prepare(model) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/accelerate/accelerator.py", line 1326, in prepare result = tuple( File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/accelerate/accelerator.py", line 1327, in self._prepare_one(obj, first_pass=True, device_placement=d) for obj, d in zip(args, device_placement) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/accelerate/accelerator.py", line 1200, in _prepare_one return self.prepare_model(obj, device_placement=device_placement) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/accelerate/accelerator.py", line 1433, in prepare_model model = model.to(self.device) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3157, in to return super().to(*args, **kwargs) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1174, in to return self._apply(convert) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply module._apply(fn) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply module._apply(fn) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply module._apply(fn) [Previous line repeated 2 more times] File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/torch/nn/modules/module.py", line 805, in _apply param_applied = fn(param) File "/maahr/home/ameen/anaconda3/envs/llama/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1160, in convert return t.to( torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 896.00 MiB. GPU 0 has a total capacity of 79.18 GiB of which 127.81 MiB is free. Including non-PyTorch memory, this process has 79.06 GiB memory in use. Of the allocated memory 77.79 GiB is allocated by PyTorch, and 564.00 KiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management ()
- Assistant
- User
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 896.00 MiB. GPU 0 has a total capacity of 79.18 GiB of which 123.81 MiB is free. Including non-PyTorch memory, this process has 79.06 GiB memory in use. Of the allocated memory 77.79 GiB is allocated by PyTorch, and 4.55 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation.
- Assistant
- User
pip upgrade gradio
- Assistant
Upgrading Gradio, a popular library for building machine learning model interfaces, is a straightforward process using pip, Python's package manager. You can upgrade Gradio to the latest version with the following command:
-
Open your terminal or command prompt.
-
Run the upgrade command:
pip install --upgrade gradio
This command will check for the latest version of Gradio available on the Python Package Index (PyPI) and install it, replacing your current version if it's outdated.
Additional Tips
-
Check the Installed Version: After upgrading, you can verify which version of Gradio is installed by running:
pip show gradio
-