Text Generation
Transformers
Safetensors
Russian
lingua_laboratorium_mechanicus
causal-lm
instruct
custom-architecture
warhammer-40k
russian
custom_code
Instructions to use GoldenGekko/LinguaLaboratoriumMechanicus-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GoldenGekko/LinguaLaboratoriumMechanicus-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GoldenGekko/LinguaLaboratoriumMechanicus-instruct", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("GoldenGekko/LinguaLaboratoriumMechanicus-instruct", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GoldenGekko/LinguaLaboratoriumMechanicus-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GoldenGekko/LinguaLaboratoriumMechanicus-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GoldenGekko/LinguaLaboratoriumMechanicus-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/GoldenGekko/LinguaLaboratoriumMechanicus-instruct
- SGLang
How to use GoldenGekko/LinguaLaboratoriumMechanicus-instruct 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 "GoldenGekko/LinguaLaboratoriumMechanicus-instruct" \ --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": "GoldenGekko/LinguaLaboratoriumMechanicus-instruct", "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 "GoldenGekko/LinguaLaboratoriumMechanicus-instruct" \ --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": "GoldenGekko/LinguaLaboratoriumMechanicus-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use GoldenGekko/LinguaLaboratoriumMechanicus-instruct with Docker Model Runner:
docker model run hf.co/GoldenGekko/LinguaLaboratoriumMechanicus-instruct
LinguaLaboratoriumMechanicus-instruct
SFT-версия LinguaLaboratoriumMechanicus на ~2500 Q&A по лору WH40k.
Архитектура
Та же, что у базовой модели (~163M параметров). Vocab 50 259 (<|user|>, <|assistant|>).
Чат-шаблон:
<|user|>
вопрос
<|assistant|>
ответ
Загрузка с trust_remote_code=True.
Использование
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "GoldenGekko/LinguaLaboratoriumMechanicus-instruct"
device = "cuda" if torch.cuda.is_available() else "cpu"
question = "Что такое Гибельный шторм и как он повлиял на ход войны?"
prompt = f"<|user|>\n{question}\n<|assistant|>\n"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(repo_id, trust_remote_code=True).to(device)
inputs = tokenizer(prompt, return_tensors="pt").to(device)
output_ids = model.generate(
inputs["input_ids"],
max_new_tokens=120,
do_sample=False,
pad_token_id=tokenizer.pad_token_id,
eos_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(output_ids[0], skip_special_tokens=True).split("<|assistant|>")[-1].strip())
Связанные репозитории
- LinguaLaboratoriumMechanicus — базовый претрейн
Citation
https://huggingface.co/GoldenGekko/LinguaLaboratoriumMechanicus-instruct
- Downloads last month
- 28
Model tree for GoldenGekko/LinguaLaboratoriumMechanicus-instruct
Base model
GoldenGekko/LinguaLaboratoriumMechanicus