Instructions to use Muhammad2003/Llama3-8B-OpenHermes-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Muhammad2003/Llama3-8B-OpenHermes-DPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Muhammad2003/Llama3-8B-OpenHermes-DPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Muhammad2003/Llama3-8B-OpenHermes-DPO") model = AutoModelForCausalLM.from_pretrained("Muhammad2003/Llama3-8B-OpenHermes-DPO", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Muhammad2003/Llama3-8B-OpenHermes-DPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Muhammad2003/Llama3-8B-OpenHermes-DPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Muhammad2003/Llama3-8B-OpenHermes-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Muhammad2003/Llama3-8B-OpenHermes-DPO
- SGLang
How to use Muhammad2003/Llama3-8B-OpenHermes-DPO with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Muhammad2003/Llama3-8B-OpenHermes-DPO" \ --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": "Muhammad2003/Llama3-8B-OpenHermes-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "Muhammad2003/Llama3-8B-OpenHermes-DPO" \ --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": "Muhammad2003/Llama3-8B-OpenHermes-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Muhammad2003/Llama3-8B-OpenHermes-DPO with Docker Model Runner:
docker model run hf.co/Muhammad2003/Llama3-8B-OpenHermes-DPO
Not trained enough?
The Llama 3 base is unusual in that it basically defaults to statements like "I don't know how to do that". Most likely as a safety mechanism.
This means you have to fine-tune every use case, such as story writing, Q&A, grammar check, poem writing, jokes, synonyms and so on. Otherwise the same base model responses pop up everywhere.
For example, when simply asking about a character/actor from a famous show or movie about half the time it's says something like "I don't know."
Also, even when it does things it doesn't strictly adhere to instructions. For example, write 9 single-word synonyms for XXX, excluding YYY, and it will write 10, including some multi-word synonyms, and one will be YYY.
In short, it appears light fine-tuning with a limited data set won't cut it with Llama 3.