Instructions to use Sermental/Sermental-Instruct-7.3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sermental/Sermental-Instruct-7.3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sermental/Sermental-Instruct-7.3B")# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Sermental/Sermental-Instruct-7.3B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Sermental/Sermental-Instruct-7.3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sermental/Sermental-Instruct-7.3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sermental/Sermental-Instruct-7.3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Sermental/Sermental-Instruct-7.3B
- SGLang
How to use Sermental/Sermental-Instruct-7.3B 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 "Sermental/Sermental-Instruct-7.3B" \ --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": "Sermental/Sermental-Instruct-7.3B", "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 "Sermental/Sermental-Instruct-7.3B" \ --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": "Sermental/Sermental-Instruct-7.3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Sermental/Sermental-Instruct-7.3B with Docker Model Runner:
docker model run hf.co/Sermental/Sermental-Instruct-7.3B
Model Card for Sermental-Instruct-7.3B
Download
from huggingface_hub import snapshot_download
from pathlib import Path
sermental_models_path = Path.home().joinpath('sermental_models', '7.3B')
sermental_models_path.mkdir(parents=True, exist_ok=True)
snapshot_download(repo_id="Sermental-Instruct-7.3B", allow_patterns=["params.json", "consolidated.safetensors", "tokenizer.model.v3"], local_dir=sermental_models_path)
Generate with transformers
If you want to use Hugging Face transformers to generate text, you can do something like this.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Sermental-Instruct-7.3B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
inputs = tokenizer("Hola, mi nombre es", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=20)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Limitations
El modelo Sermental Instruct 7.3B es una demostraci贸n r谩pida de que el modelo base se puede ajustar f谩cilmente para lograr un rendimiento convincente. No tiene ning煤n mecanismo de moderaci贸n. Esperamos interactuar con la comunidad en formas de Haga que el modelo respete finamente las barreras de protecci贸n, lo que permite la implementaci贸n en entornos que requieren salidas moderadas.
- Downloads last month
- -