Run this model with HF Jobs
Run mlx-community/OpenHermes-2.5-Mistral-7B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/mlx-community/OpenHermes-2.5-Mistral-7B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/mlx-community/OpenHermes-2.5-Mistral-7B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/mlx-community/OpenHermes-2.5-Mistral-7B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/mlx-community/OpenHermes-2.5-Mistral-7B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use mlx-community/OpenHermes-2.5-Mistral-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/OpenHermes-2.5-Mistral-7B with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/OpenHermes-2.5-Mistral-7B") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use mlx-community/OpenHermes-2.5-Mistral-7B with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "mlx-community/OpenHermes-2.5-Mistral-7B" --prompt "Once upon a time"
- Atomic Chat
OpenHermes-2.5-Mistral-7B
Model description
Please, refer to the original model card for more details on OpenHermes-2.5-Mistral-7B.
Use with mlx-llm
Install mlx-llm from GitHub.
git clone https://github.com/riccardomusmeci/mlx-llm
cd mlx-llm
pip install .
Test with simple generation
from mlx_llm.model import create_model, create_tokenizer, generate
model = create_model("OpenHermes-2.5-Mistral-7B") # it downloads weights from this space
tokenizer = create_tokenizer("OpenHermes-2.5-Mistral-7B")
generate(
model=model,
tokenizer=tokenizer,
prompt="What's the meaning of life?",
max_tokens=200,
temperature=.1
)
Quantize the model weights
from mlx_llm.model import create_model, quantize, save_weights
model = create_model(model_name)
model = quantize(model, group_size=64, bits=4)
save_weights(model, "weights.npz")
Use it in chat mode (don't worry about the prompt, the library takes care of it.)
from mlx_llm.playground.chat import ChatLLM
personality = "You're a salesman and beet farmer known as Dwight K Schrute from the TV show The Office. Dwight replies just as he would in the show. You always reply as Dwight would reply. If you don't know the answer to a question, please don't share false information."
# examples must be structured as below
examples = [
{
"user": "What is your name?",
"model": "Dwight K Schrute",
},
{
"user": "What is your job?",
"model": "Assistant Regional Manager. Sorry, Assistant to the Regional Manager."
}
]
chat_llm = ChatLLM.build(
model_name="OpenHermes-2.5-Mistral-7B",
tokenizer="mlx-community/OpenHermes-2.5-Mistral-7B", # HF tokenizer or a local path to a tokenizer
personality=personality,
examples=examples,
)
chat_llm.run(max_tokens=500, temp=0.1)
With mlx-llm you can also play with a simple RAG. Go check the examples.
- Downloads last month
- 117
