phi2 command line tools with apple mps support
Project description
phi2-mps
An opinionated CLI to use Microsoft Phi-2 Model on your macOS!
You should have at least 8GB of memory to run this SLM on Apple silicon
Start
Install phi2-mps with pip:
pip install phi2-mps
Download Phi-2 Model with this url:
# this may take a while,cause the model size is about 5.18G
wget https://huggingface.co/AlexWuKing/atomgradient_models/resolve/main/weights.npz
Run inference from any path on your computer:
# [weights.npz] should be the download path of the model file
phi2-mps --model weights.npz --prompt "Hi how are you" --max_tokens 256
[!NOTE] The CLI is highly opinionated and only works on Apple MPS.
CLI Options
The whisper-mps repo provides an all round support for running Whisper in various settings. More command-line support will be provided later
--model MODEL-PATH
Local model file path where you put the weights file
--prompt PROMPT
The prompt will send to model to gen tokens
--max_tokens MAX-TOKEN
The Total number of tokens will be replied to you
WE ARE HIRING
refer here: https://daxiang.feishu.cn/docx/LluCd7J38o9U5pxN3kdcpSh6nEh
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phi2_mps-0.0.4.tar.gz.
File metadata
- Download URL: phi2_mps-0.0.4.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.11.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99779c7352e9b210fa1784b27e8cf6de2f5930bf4f3b1284cfe8fb7e8f0d1b5c
|
|
| MD5 |
1584c03cb04bc0efa0da1d5fc3c40a84
|
|
| BLAKE2b-256 |
09e50bd262153faf6ce2d033ce76a935a28a415780658bcac4be1f299c645324
|
File details
Details for the file phi2_mps-0.0.4-py3-none-any.whl.
File metadata
- Download URL: phi2_mps-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.11.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4aead08faa56b1f5d06b6e8cd7d6558633c5982b60554d825e3cbb5b2bfdc0d
|
|
| MD5 |
f7ba33cafdaa17437ea5ba1be14e0b1c
|
|
| BLAKE2b-256 |
152bfebfa19898ea2d2af39ccda632fefc118c72abf498ff5088f864a56bf849
|