mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-25 01:41:19 +08:00
Update model card uploaded with converted models (#309)
This commit is contained in:
parent
1fa40067fe
commit
ef93979973
@ -149,11 +149,16 @@ def upload_to_hub(path: str, upload_repo: str, hf_path: str):
|
|||||||
This model was converted to MLX format from [`{hf_path}`]().
|
This model was converted to MLX format from [`{hf_path}`]().
|
||||||
Refer to the [original model card](https://huggingface.co/{hf_path}) for more details on the model.
|
Refer to the [original model card](https://huggingface.co/{hf_path}) for more details on the model.
|
||||||
## Use with mlx
|
## Use with mlx
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install mlx
|
pip install mlx-lm
|
||||||
git clone https://github.com/ml-explore/mlx-examples.git
|
```
|
||||||
cd mlx-examples/llms/hf_llm
|
|
||||||
python generate.py --model {upload_repo} --prompt "My name is"
|
```python
|
||||||
|
from mlx_lm import load, generate
|
||||||
|
|
||||||
|
model, tokenizer = load("{upload_repo}")
|
||||||
|
response = generate(model, tokenizer, prompt="hello", verbose=True)
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
card.save(os.path.join(path, "README.md"))
|
card.save(os.path.join(path, "README.md"))
|
||||||
|
Loading…
Reference in New Issue
Block a user