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", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- 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
Upload MistralForCausalLM
#4
by Locutusque - opened
model-00006-of-00008.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1946243984
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:354e29b697ee703e015757a19ea58af6a5508019a906627e151227081fc79334
|
| 3 |
size 1946243984
|
model-00007-of-00008.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1979781448
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bbc78455002a050453a2146aa30583b1a84c029a3f80061396eabe90d4b95077
|
| 3 |
size 1979781448
|
model-00008-of-00008.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 815834680
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:531c709805b1243acde05916ec62e80cb168659d87609b39049a426159b5c564
|
| 3 |
size 815834680
|