Comments (2)
Can you try saving the phi-2 model without saving the phi-2 tokenizer, like this:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
torch.set_default_device("cuda")
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", torch_dtype="auto", trust_remote_code=True)
model.save_pretrained("./saved_model")
Then try to compile it as you did last time.
from llama.cpp.
@nicolasperez19 Thank you for your response but how is the model supposed to work without a tokenizer?
I tried the code you mentioned and llamacpp is expecting the tokenizer to be there:
INFO:hf-to-gguf:Loading model: saved_model
INFO:gguf.gguf_writer:gguf: This GGUF file is for Little Endian only
INFO:hf-to-gguf:Set model parameters
INFO:hf-to-gguf:Set model tokenizer
Traceback (most recent call last):
File "/home/cc/polymorph/edge-setup/llama.cpp/convert-hf-to-gguf.py", line 2856, in <module>
main()
File "/home/cc/polymorph/edge-setup/llama.cpp/convert-hf-to-gguf.py", line 2841, in main
model_instance.set_vocab()
File "/home/cc/polymorph/edge-setup/llama.cpp/convert-hf-to-gguf.py", line 116, in set_vocab
self._set_vocab_gpt2()
File "/home/cc/polymorph/edge-setup/llama.cpp/convert-hf-to-gguf.py", line 502, in _set_vocab_gpt2
tokens, toktypes, tokpre = self.get_vocab_base()
File "/home/cc/polymorph/edge-setup/llama.cpp/convert-hf-to-gguf.py", line 377, in get_vocab_base
tokenizer = AutoTokenizer.from_pretrained(self.dir_model)
File "/home/cc/miniconda3/envs/peftenv/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py", line 855, in from_pretrained
return tokenizer_class_fast.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
File "/home/cc/miniconda3/envs/peftenv/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2070, in from_pretrained
raise EnvironmentError(
OSError: Can't load tokenizer for 'saved_model'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'saved_model' is the correct path to a directory containing all relevant files for a CodeGenTokenizerFast tokenizer.
from llama.cpp.
Related Issues (20)
- Refactor: Add CONTRIBUTING.md and/or update PR template with [no ci] tips HOT 4
- Why is convert.py missing? HOT 15
- When using GPU (OpenCL), the reply speed is slower and all replies are incorrect?? HOT 16
- Bug: The output of llama.cpp with Phi-3 contains Non-sense/meaningless words, Does anyone encounter the similar problem? HOT 15
- Bug: Incorrect memory allocation when mixing Nvidia and AMD GPU's HOT 2
- Bug: value of keep alive max count in cpp-httplib hardcoded too low
- Feature Request: GGUF 2 BIN HOT 2
- Bug: JSON Schema Not Respected ? HOT 9
- Feature Request: Prevent server.exe from being detected as ? Trojan:Win32/Wacatac.B!ml
- Bug: convert-hf-to-gguf-update.py breaks in Windows Python 3.11.5 HOT 10
- Bug: Could NOT find BLAS (missing: BLAS_LIBRARIES) HOT 2
- Bug: Phi-3 4K output broken after 2000~ tokens (Reproducible) HOT 9
- Bug: test run on stories15M-q4_0.gguf result in Segmentation fault. HOT 3
- GGUF models inference speed - Why is GGUF model inference fast on my Mac but slow on cluster?
- [SYCL] Bug: check_allow_gpu_index error: device_index:0 is out of range: [0--2] HOT 1
- Bug: STATIC COMPILE not static anymore :( HOT 2
- Bug: Grammar readme seems incorrect HOT 2
- Bug: GGUF of Llama 3 8B appears to use smaug-bpe pretokenizer? HOT 6
- llama : support Mamba-2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llama.cpp.