Instructions to use VeriUs/VeriUS-LLM-8b-v0.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VeriUs/VeriUS-LLM-8b-v0.2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="VeriUs/VeriUS-LLM-8b-v0.2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("VeriUs/VeriUS-LLM-8b-v0.2") model = AutoModelForCausalLM.from_pretrained("VeriUs/VeriUS-LLM-8b-v0.2") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use VeriUs/VeriUS-LLM-8b-v0.2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "VeriUs/VeriUS-LLM-8b-v0.2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VeriUs/VeriUS-LLM-8b-v0.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/VeriUs/VeriUS-LLM-8b-v0.2
- SGLang
How to use VeriUs/VeriUS-LLM-8b-v0.2 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 "VeriUs/VeriUS-LLM-8b-v0.2" \ --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": "VeriUs/VeriUS-LLM-8b-v0.2", "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 "VeriUs/VeriUS-LLM-8b-v0.2" \ --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": "VeriUs/VeriUS-LLM-8b-v0.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use VeriUs/VeriUS-LLM-8b-v0.2 with Docker Model Runner:
docker model run hf.co/VeriUs/VeriUS-LLM-8b-v0.2
VeriUS LLM 8b v0.2
VeriUS LLM is a instruct following large language model supporting Turkish language based on llama3-8B.
Model Details
Base Model: unsloth/llama-3-8b-bnb-4bit
Training Dataset: A carefully curated general domain Turkish instruction dataset.
Training Method: Fine-tuned using QLoRA and ORPO
#TrainingArguments
PER_DEVICE_BATCH_SIZE: 2
GRADIENT_ACCUMULATION_STEPS: 4
WARMUP_RATIO: 0.03
NUM_EPOCHS: 2
LR: 0.000008
OPTIM: "adamw_8bit"
WEIGHT_DECAY: 0.01
LR_SCHEDULER_TYPE: "linear"
BETA: 0.1
#PEFT Arguments
RANK: 128
TARGET_MODULES:
- "q_proj"
- "k_proj"
- "v_proj"
- "o_proj"
- "gate_proj"
- "up_proj"
- "down_proj"
LORA_ALPHA: 256
LORA_DROPOUT: 0
BIAS: "none"
GRADIENT_CHECKPOINT: 'unsloth'
USE_RSLORA: false\
Usage
This model is trained used Unsloth and uses it for fast inference. For Unsloth installation please refer to: https://github.com/unslothai/unsloth
This model can also be loaded with AutoModelForCausalLM
How to load with unsloth:
from unsloth import FastLanguageModel
max_seq_len = 1024
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="VeriUs/VeriUS-LLM-8b-v0.2",
max_seq_length=max_seq_len,
dtype=None
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
prompt_tempate = """AΕaΔΔ±da, gΓΆrevini aΓ§Δ±klayan bir talimat ve daha fazla baΔlam saΔlayan bir girdi verilmiΕtir. Δ°steΔi uygun bir Εekilde tamamlayan bir yanΔ±t yaz.
### Talimat:
{}
### Girdi:
{}
### YanΔ±t:
"""
def generate_output(instruction, user_input):
input_ids = tokenizer(
[
prompt_tempate.format(instruction, user_input)
], return_tensors="pt").to("cuda")
outputs = model.generate(**input_ids, max_length=max_seq_len, do_sample=True)
# removes prompt, comment this out if you want to see it.
outputs = [output[len(input_ids[i].ids):] for i, output in enumerate(outputs)]
return tokenizer.decode(outputs[0], skip_special_tokens=True)
response = generate_output("TΓΌrkiye'nin en kalabalΔ±k Εehri hangisidir?", "")
print(response)
Bias, Risks, and Limitations
Limitations and Known Biases Primary Function and Application: VeriUS LLM, an autoregressive language model, is primarily designed to predict the next token in a text string. While often used for various applications, it is important to note that it has not undergone extensive real-world application testing. Its effectiveness and reliability across diverse scenarios remain largely unverified.
Language Comprehension and Generation: The base model is primarily trained in standard English. Even though it fine-tuned with and Turkish dataset, its performance in understanding and generating slang, informal language, or other languages may be limited, leading to potential errors or misinterpretations.
Generation of False Information: Users should be aware that VeriUS LLM may produce inaccurate or misleading information. Outputs should be considered as starting points or suggestions rather than definitive answers.
- Downloads last month
- 12