Instructions to use Locutusque/Llama-3-NeuralHercules-5.0-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Locutusque/Llama-3-NeuralHercules-5.0-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Locutusque/Llama-3-NeuralHercules-5.0-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Locutusque/Llama-3-NeuralHercules-5.0-8B") model = AutoModelForMultimodalLM.from_pretrained("Locutusque/Llama-3-NeuralHercules-5.0-8B") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Locutusque/Llama-3-NeuralHercules-5.0-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Locutusque/Llama-3-NeuralHercules-5.0-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Locutusque/Llama-3-NeuralHercules-5.0-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Locutusque/Llama-3-NeuralHercules-5.0-8B
- SGLang
How to use Locutusque/Llama-3-NeuralHercules-5.0-8B 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 "Locutusque/Llama-3-NeuralHercules-5.0-8B" \ --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": "Locutusque/Llama-3-NeuralHercules-5.0-8B", "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 "Locutusque/Llama-3-NeuralHercules-5.0-8B" \ --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": "Locutusque/Llama-3-NeuralHercules-5.0-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Locutusque/Llama-3-NeuralHercules-5.0-8B with Docker Model Runner:
docker model run hf.co/Locutusque/Llama-3-NeuralHercules-5.0-8B
Llama-3-NeuralHercules-5.0-8B
Model Details
- Model Name: Locutusque/Llama-3-NeuralHercules-5.0-8B
- Base Model: meta-llama/Meta-Llama-3-8B
- Publisher: Locutusque
- Model Type: Question answering, conversational AI, code generation, medical text comprehension, mathematical reasoning, logical reasoning.
- Language: multi-lingual
- License: Apache-2.0
Model Description
Locutusque/Llama-3-NeuralHercules-5.0-8B is a state-of-the-art language model fine-tuned on the hercules-v5.0 and mlabonne/orpo-dpo-mix-40k dataset for advanced reasoning across scientific domains. This model is designed to handle complex inquiries and instructions, leveraging the diverse and rich information contained in the Hercules dataset. Its primary use cases include but are not limited to complex question answering, conversational understanding, code generation, medical text comprehension, mathematical reasoning, and logical reasoning.
Intended Use
This model is intended for researchers and practitioners looking for a powerful tool to tackle challenging problems in scientific domains. It can be used in the following scenarios:
- AI-driven tutoring systems for science, medicine, mathematics, and computer science.
- Assistive tools for professionals requiring fast and accurate domain-specific information retrieval.
- Platforms that require conversational AI capabilities with a focus on technical and scientific reasoning.
- Automation in code generation and understanding complex programming context.
Training Data
The Locutusque/Llama-3-NeuralHercules-5.0-8B model was fine-tuned on all examples of the hercules-v5.0 dataset for 2 epochs, which amalgamates various datasets rich in diversity and complexity, including programming, medical texts, mathematical problems, and reasoning tasks. Then, it is further fine-tuned on the mlabonne/orpo-dpo-mix-40k dataset using DPO.
Evaluation Results
| Tasks | Version | Filter | n-shot | Metric | Value | Stderr | ||
|---|---|---|---|---|---|---|---|---|
| agieval_nous | N/A | none | 0 | acc_norm | ↑ | 0.3943 | ± | 0.0094 |
| none | 0 | acc | ↑ | 0.3928 | ± | 0.0094 | ||
| - agieval_aqua_rat | 1 | none | 0 | acc | ↑ | 0.2126 | ± | 0.0257 |
| none | 0 | acc_norm | ↑ | 0.2323 | ± | 0.0265 | ||
| - agieval_logiqa_en | 1 | none | 0 | acc | ↑ | 0.3425 | ± | 0.0186 |
| none | 0 | acc_norm | ↑ | 0.3625 | ± | 0.0189 | ||
| - agieval_lsat_ar | 1 | none | 0 | acc | ↑ | 0.2174 | ± | 0.0273 |
| none | 0 | acc_norm | ↑ | 0.2000 | ± | 0.0264 | ||
| - agieval_lsat_lr | 1 | none | 0 | acc | ↑ | 0.4020 | ± | 0.0217 |
| none | 0 | acc_norm | ↑ | 0.3843 | ± | 0.0216 | ||
| - agieval_lsat_rc | 1 | none | 0 | acc | ↑ | 0.5651 | ± | 0.0303 |
| none | 0 | acc_norm | ↑ | 0.5651 | ± | 0.0303 | ||
| - agieval_sat_en | 1 | none | 0 | acc | ↑ | 0.6602 | ± | 0.0331 |
| none | 0 | acc_norm | ↑ | 0.6456 | ± | 0.0334 | ||
| - agieval_sat_en_without_passage | 1 | none | 0 | acc | ↑ | 0.4466 | ± | 0.0347 |
| none | 0 | acc_norm | ↑ | 0.4563 | ± | 0.0348 | ||
| - agieval_sat_math | 1 | none | 0 | acc | ↑ | 0.4000 | ± | 0.0331 |
| none | 0 | acc_norm | ↑ | 0.4000 | ± | 0.0331 | ||
| gsm8k | 3 | strict-match | 5 | exact_match | ↑ | 0.4920 | ± | 0.0138 |
| flexible-extract | 5 | exact_match | ↑ | 0.4958 | ± | 0.0138 | ||
| truthfulqa_mc2 | 2 | none | 0 | acc | ↑ | 0.5465 | ± | 0.0152 |
| arc_challenge | 1.0 | none | 0 | acc | ↑ | 0.5606 | ± | 0.0145 |
| none | 0 | acc_norm | ↑ | 0.5836 | ± | 0.0144 | ||
| arc_easy | 1 | none | 0 | acc | ↑ | 0.8325 | ± | 0.0077 |
| none | 0 | acc_norm | ↑ | 0.8056 | ± | 0.0081 | ||
| boolq | 2 | none | 0 | acc | ↑ | 0.8260 | ± | 0.0066 |
| hellaswag | 1 | none | 0 | acc | ↑ | 0.6534 | ± | 0.0047 |
| none | 0 | acc_norm | ↑ | 0.8372 | ± | 0.0037 | ||
| openbookqa | 1 | none | 0 | acc | ↑ | 0.3500 | ± | 0.0214 |
| none | 0 | acc_norm | ↑ | 0.4660 | ± | 0.0223 | ||
| piqa | 1 | none | 0 | acc | ↑ | 0.8096 | ± | 0.0092 |
| none | 0 | acc_norm | ↑ | 0.8270 | ± | 0.0088 | ||
| winogrande | 1 | none | 0 | acc | ↑ | 0.7640 | ± | 0.0119 |
| eq_bench | 2.1 | none | 0 | eqbench | ↑ | 52.9249 | ± | 3.0923 |
How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Locutusque/Llama-3-NeuralHercules-5.0-8B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# For a text generation task
input_text = "<|im_start|>user\nWhat are the implications of Einstein's theory of relativity in modern physics?<|im_end|>\n<|im_start|>assistant\n"
input_ids = tokenizer.encode(input_text, return_tensors="pt")
# Generate a response
outputs = model.generate(input_ids, max_length=200, num_return_sequences=1, temperature=0.8, top_p=0.95, top_k=40, repetition_penalty=1.1)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Known Limitations
The diversity of the dataset could lead to inconsistencies in the model's responses due to variations in data formatting and annotation quality.
- Downloads last month
- 8