teknium/OpenHermes-2.5
Viewer • Updated • 1M • 21.4k • 833
How to use vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B", dtype="auto")How to use vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B
How to use vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B with Docker Model Runner:
docker model run hf.co/vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B
Hermes 2 Pro's LLaMA weights + BakLLaVA's mm_projector & vision_tower weights.
Good QA + Function Calling + JSON Mode + Vision Multimodal
GGUFs:
Test code:
from llava.mm_utils import get_model_name_from_path
from llava.eval.run_llava import eval_model
model_path = "vonjack/Hermes-2-Pro-BakLLaVA-Mistral-7B"
prompt = "What's the content of the image?"
image_file = "https://www.ilankelman.org/stopsigns/australia.jpg"
args = type('Args', (), {
"model_path": model_path,
"model_base": None,
"model_name": get_model_name_from_path(model_path),
"query": prompt,
"conv_mode": None,
"image_file": image_file,
"sep": ",",
"temperature": 0,
"top_p": None,
"num_beams": 1,
"max_new_tokens": 512
})()
eval_model(args)
Base model
mistralai/Mistral-7B-v0.1