Instructions to use olafgeibig/phi-2-OpenHermes-2.5-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use olafgeibig/phi-2-OpenHermes-2.5-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="olafgeibig/phi-2-OpenHermes-2.5-GGUF", filename="phi-2-openhermes-2.5.Q4_K_M.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use olafgeibig/phi-2-OpenHermes-2.5-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M
Use Docker
docker model run hf.co/olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use olafgeibig/phi-2-OpenHermes-2.5-GGUF with Ollama:
ollama run hf.co/olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M
- Unsloth Studio
How to use olafgeibig/phi-2-OpenHermes-2.5-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for olafgeibig/phi-2-OpenHermes-2.5-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for olafgeibig/phi-2-OpenHermes-2.5-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for olafgeibig/phi-2-OpenHermes-2.5-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use olafgeibig/phi-2-OpenHermes-2.5-GGUF with Docker Model Runner:
docker model run hf.co/olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M
- Lemonade
How to use olafgeibig/phi-2-OpenHermes-2.5-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull olafgeibig/phi-2-OpenHermes-2.5-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.phi-2-OpenHermes-2.5-GGUF-Q4_K_M
List all available models
lemonade list
phi-2-OpenHermes-2.5
I converted minghaowu/phi-2-OpenHermes-2.5 to GGUF and quantized it to my favorite quantizations. A phi-2 fine-tuned on OpenHermes-2.5.
I quickly quantized this model using a modified version of AutoGGUF from Maxime Labonne
The prompt format is a little bit guesswork but it seems to work. Here is my Ollama modelfile:
FROM ./phi-2-openhermes-2.5.Q5_K_M.gguf
PARAMETER num_ctx 2048
TEMPLATE """{{ .System }}
### USER: {{ .Prompt }}<|endoftext|>
### ASSISTANT:
"""
PARAMETER stop "<|endoftext|>"
Many Kudos to Microsoft, Teknium and Minghao Wu
Original Modelcard
This model is a fine-tuned version of microsoft/phi-2 on the teknium/OpenHermes-2.5 dataset.
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 4
- eval_batch_size: 8
- seed: 42
- distributed_type: multi-GPU
- num_devices: 2
- gradient_accumulation_steps: 16
- total_train_batch_size: 128
- total_eval_batch_size: 16
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 1.0
Training results
Framework versions
- Transformers 4.37.2
- Pytorch 2.0.1+cu117
- Datasets 2.16.1
- Tokenizers 0.15.1
Inference
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_id = "minghaowu/phi-2-OpenHermes-2.5"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, device_map="auto")
your_instruction = <your_instruction>
infer_prompt = f"### USER: {your_instruction} <|endoftext|>\n### ASSISTANT:"
output = pipe(infer_prompt, do_sample=True, max_new_tokens=256)[0]["generated_text"]
print(output)
- Downloads last month
- 21
4-bit
5-bit
6-bit
Model tree for olafgeibig/phi-2-OpenHermes-2.5-GGUF
Base model
microsoft/phi-2