Instructions to use Locutusque/Hercules-3.0-Mistral-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Locutusque/Hercules-3.0-Mistral-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Locutusque/Hercules-3.0-Mistral-7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Locutusque/Hercules-3.0-Mistral-7B") model = AutoModelForCausalLM.from_pretrained("Locutusque/Hercules-3.0-Mistral-7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Locutusque/Hercules-3.0-Mistral-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Locutusque/Hercules-3.0-Mistral-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Locutusque/Hercules-3.0-Mistral-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Locutusque/Hercules-3.0-Mistral-7B
- SGLang
How to use Locutusque/Hercules-3.0-Mistral-7B 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/Hercules-3.0-Mistral-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Locutusque/Hercules-3.0-Mistral-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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/Hercules-3.0-Mistral-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Locutusque/Hercules-3.0-Mistral-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Locutusque/Hercules-3.0-Mistral-7B with Docker Model Runner:
docker model run hf.co/Locutusque/Hercules-3.0-Mistral-7B
Model Card: Hercules-3.0-Mistral-7B
Model Description
Hercules-3.0-Mistral-7B is a fine-tuned language model derived from Mistralai/Mistral-7B-v0.1. It is specifically designed to excel in instruction following, function calls, and conversational interactions across various scientific and technical domains. The dataset used for fine-tuning, also named Hercules-v3.0, expands upon the diverse capabilities of OpenHermes-2.5 with contributions from numerous curated datasets. This fine-tuning has hercules-v3.0 with enhanced abilities in:
- Complex Instruction Following: Understanding and accurately executing multi-step instructions, even those involving specialized terminology.
- Function Calling: Seamlessly interpreting and executing function calls, providing appropriate input and output values.
- Domain-Specific Knowledge: Engaging in informative and educational conversations about Biology, Chemistry, Physics, Mathematics, Medicine, Computer Science, and more.
Intended Uses & Potential Bias
Hercules-3.0-Mistral-7B is well-suited to the following applications:
- Specialized Chatbots: Creating knowledgeable chatbots and conversational agents in scientific and technical fields.
- Instructional Assistants: Supporting users with educational and step-by-step guidance in various disciplines.
- Code Generation and Execution: Facilitating code execution through function calls, aiding in software development and prototyping.
Important Note: Although Hercules-v3.0 is carefully constructed, it's important to be aware that the underlying data sources may contain biases or reflect harmful stereotypes. Use this model with caution and consider additional measures to mitigate potential biases in its responses.
Limitations and Risks
- Toxicity: The dataset contains toxic or harmful examples.
- Hallucinations and Factual Errors: Like other language models, Hercules-3.0-Mistral-7B may generate incorrect or misleading information, especially in specialized domains where it lacks sufficient expertise.
- Potential for Misuse: The ability to engage in technical conversations and execute function calls could be misused for malicious purposes.
Training Data
Hercules-3.0-Mistral-7B is fine-tuned from the following sources:
cognitivecomputations/dolphinEvol Instruct 70K & 140Kteknium/GPT4-LLM-Cleanedjondurbin/airoboros-3.2AlekseyKorshuk/camel-chatmlCollectiveCognition/chats-data-2023-09-22Nebulous/lmsys-chat-1m-smortmodelsonlyglaiveai/glaive-code-assistant-v2glaiveai/glaive-code-assistantglaiveai/glaive-function-calling-v2garage-bAInd/Open-Platypusmeta-math/MetaMathQAteknium/GPTeacher-General-InstructGPTeacher roleplay datasetsBI55/MedTextpubmed_qa labeled subsetUnnatural InstructionsM4-ai/LDJnr_combined_inout_formatCollectiveCognition/chats-data-2023-09-27CollectiveCognition/chats-data-2023-10-16NobodyExistsOnTheInternet/sharegptPIPPAyuekai/openchat_sharegpt_v3_vicuna_formatise-uiuc/Magicoder-Evol-Instruct-110KSquish42/bluemoon-fandom-1-1-rp-cleanedsablo/oasst2_curated
Training Procedure
- This model was trained on 8 kaggle TPUs, using torch xla SPMD for high MXU efficiency. There was no expense on my end (meaning you can reproduce this too!)
- A learning rate of 2e-06 with the Adam optimizer. A linear scheduler was used, with an end factor of 0.3. A low learning rate was used to prevent exploding gradients.
- No mixed precision was used, with the default dtype being bfloat16.
- Trained on 1,400,000 examples of Hercules-v3.0
- No model parameters were frozen.
- This model was trained on OpenAI's ChatML prompt format. Because this model has function calling capabilities, the prompt format is slightly different, here's what it would look like:
<|im_start|>system\n{message}<|im_end|>\n<|im_start|>user\n{user message}<|im_end|>\n<|im_start|>call\n{function call message}<|im_end|>\n<|im_start|>function\n{function response message}<|im_end|>\n<|im_start|>assistant\n{assistant message}</s>
This model was fine-tuned using the TPU-Alignment repository. https://github.com/Locutusque/TPU-Alignment
Disclaimer
A dataset used in the Hercules-v3.0 was found to be causing performance degradation issues. I would recommend using Hercules-2.5 over this model, until Hercules-3.1 is released.
Quants
ExLlamaV2 by bartowski https://huggingface.co/bartowski/Hercules-3.0-Mistral-7B-exl2
- Downloads last month
- 97
