Comments (8)
Microsoft has changed the config / layers naming in January, ct2 was never updated with this.
https://huggingface.co/microsoft/phi-2/commit/cb2f4533604d8b67de604e7df03bfe6f3ca22869#d2h-639018
from ctranslate2.
This might be a good opportunity for to try my hand at a pull request with ctranslate2 even though I know zero about C++...but it seems relatively simple to modify the converter for phi...
from ctranslate2.
For the exactly 2-3 other people in the universe who care about this ;-) here's a link where you can download the older version, but just fyi you have to download the files individually, you can't clone:
https://huggingface.co/microsoft/phi-2/tree/f6ba9c82af0f69e735470b457751c2726e3bbe3c
from ctranslate2.
Last comment for me for the day...but here's what I get when trying to load the model with the sample llama2 script chat.py
that guillikam made:
Traceback (most recent call last):
File "D:\ctranslate2\chat.py", line 93, in <module>
main()
File "D:\ctranslate2\chat.py", line 10, in main
sp = spm.SentencePieceProcessor(os.path.join(model_dir, "tokenizer.model"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ctranslate2\Lib\site-packages\sentencepiece\__init__.py", line 468, in Init
self.Load(model_file=model_file, model_proto=model_proto)
File "D:\ctranslate2\Lib\site-packages\sentencepiece\__init__.py", line 961, in Load
return self.LoadFromFile(model_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ctranslate2\Lib\site-packages\sentencepiece\__init__.py", line 316, in LoadFromFile
return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: Not found: "phi-2-ct2-float16\tokenizer.model": No such file or directory Error #2
It seems I was able to convert phi-2, but for whatever reason it didn't create the tokenizer.model in the new folder like it does when converting Mistral and other models...
[edit] I just realized that is way above my experience level...but maybe this'll help??
https://chat.openai.com/share/84e8c2a0-fab5-41d7-a84a-7f195d2f25f2
from ctranslate2.
when convert the model, you can add this option to save the tokenizer.model
in your folder: --copy_files tokenizer.model
from ctranslate2.
Thanks @minhthuc2502 , but the repository doesn't seem to have a tokenizer.model
, which is part of my confusion. BTW, I communicated with the guy who originally did the phi loader/converter, Michael Feil, and he said he doesn't have time to update it to adapt to the changes that Microsoft made to the model in January, 2024. I'd love to try but have no way of visualizing a model's architecture (Netron is mediocre for Pytorch models), and have zero c++ experience. Do you have a sense of if/when the phi loader/converter will be updated by you or someone else? Not a huge deal, just wondering. Anyways, here's where it says no tokenizer.model...I noticed that Michael Feil's ctranslate2 conversion of Phi 1.5 (before Microsoft's change) doesn't have that file...
from ctranslate2.
It seems like you can't use sentenpiece
in chat.py
to tokenize the input. You can directly use tokenizer of transformers like: tokenizer = AutoTokenizer.from_pretrained(target_model, trust_remote_code=True)
.
We have no plans to do an update right now but it would be done if there is time.
from ctranslate2.
I withdraw this "issue" because phi-2 is too difficult and when it does work, the results are poor...HOWEVER, I strongly recommend updating the scope "StableLM" models that ctranslate2 supports. The new Zephyr is awesome, for example, but there are a slew of other small 3b models that StableLM makes that are best for their sizes IMHO.
from ctranslate2.
Related Issues (20)
- Can't hide GPUs to get_cuda_device_count() HOT 5
- opus-mt-en-zh does not respect the end token
- I got invalid conversion error when compile on linux HOT 2
- CTranslate2 cmake error when trying to build the code from source with cuda support enabled on Windows. HOT 6
- libctranslate2-81fc0d88.so.4.2.1 in python package has executable stack flag
- Whisper encode roughly 4x slower than openai/pytorch HOT 1
- Option --self_attn_type scaled-dot-flash is not supported (supported values are: scaled-dot) HOT 6
- Doesn't build without docker. libiomp5 not found HOT 6
- Clang unusual switches wrongly hardcoded in resulting setup.py HOT 3
- Support for Phi3-Small, Medium, and Vision HOT 1
- Different results when run with tensor parallelism HOT 2
- CUDA DeviceAllocate segfault HOT 3
- Converter not working for NLLB models HOT 5
- Ctranslate2 Pypi exceeds limit 20GB
- Facing issues with Ctranslate2 when working with Intel built-in GPU and oneDNN HOT 5
- Proper way to change alignment_heads and alignment_layer when using return_attention=True for converted HF Seq2Seq Transformers?
- Feature Request: Implement Static Cache and Quantization Techniques in CTranslate2 HOT 6
- T5 inference result is all <pad> HOT 2
- Does CT2/OpenNMT engine support Qualcomm SoC? HOT 1
- Qwen2 Support? HOT 1
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 ctranslate2.