Instructions to use Xalk07/KSTU_T-lite-2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Xalk07/KSTU_T-lite-2.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Xalk07/KSTU_T-lite-2.1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Xalk07/KSTU_T-lite-2.1") model = AutoModelForCausalLM.from_pretrained("Xalk07/KSTU_T-lite-2.1", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Xalk07/KSTU_T-lite-2.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Xalk07/KSTU_T-lite-2.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xalk07/KSTU_T-lite-2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Xalk07/KSTU_T-lite-2.1
- SGLang
How to use Xalk07/KSTU_T-lite-2.1 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 "Xalk07/KSTU_T-lite-2.1" \ --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": "Xalk07/KSTU_T-lite-2.1", "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 "Xalk07/KSTU_T-lite-2.1" \ --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": "Xalk07/KSTU_T-lite-2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Xalk07/KSTU_T-lite-2.1 with Docker Model Runner:
docker model run hf.co/Xalk07/KSTU_T-lite-2.1
Русский
KSTU_T-lite-2.1 - это дообученная модель на основе T-lite-it-2.1 от Т-банка. Предназначена для помощи в поиске и выдаче информации об университетском комплексе КГТУ, Россия. В университетский комплекс входит четыре образовательных организации: Калининградский Государственный Технический Университет (КГТУ), Балтийская Государственная Академия Рыбопромыслового Флота (БГАРФ), Калининградский Морской Рыбопромышленный Колледж (КМРК) и Санкт-Петербургский Морской Рыбопромышленный Колледж (СПбМРК).
Модель обучалась в 2 этапа: дополнение предложения (2 эпохи) и обучения инструкциям (3 эпохи). И знает о событиях до второй половины 2025 года.
Метрики:
| Метрики | 1 этап (2 эпохи) | 2 этап (3 эпохи) |
|---|---|---|
| ROUGE-1 | 0,0406 | 0,0602 |
| ROUGE-2 | 0,0037 | 0,0238 |
| ROUGE-L | 0,0343 | 0,0596 |
| PRECISION | 0,1314 | 0,1798 |
| RECALL | 0,1372 | 0,2138 |
| F1 | 0,1203 | 0,1774 |
Сравнение с другим проектом от Донецкого Государственного университета:
| Метрики | KSTU_T-lite-2.1 5 эпох |
Ассистент Донецкого Государственного университета LLaMA-3.1-8b 25 эпох |
|---|---|---|
| ROUGE-1 | 0,0602 | 0,1331 |
| ROUGE-2 | 0,0238 | 0,0721 |
| ROUGE-L | 0,0596 | 0,1320 |
| PRECISION | 0,1798 | - |
| RECALL | 0,2138 | - |
| F1 | 0,1774 | - |
Использование: Вы можете использовать эту модель, квантизированные варианты или интерактивное пространство. Квантизированные варианты созданы, но пока не добавлены на сайт. Когда появятся, описание будет изменено. Интерактивное пространство ещё не создано, в планах.
Python:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
import logging
import warnings
torch.manual_seed(42)
MODEL_PATH = "./KSTU_T-lite-2.1"
if torch.cuda.is_available():
DEVICE = "cuda"
elif getattr(torch.backends, "mps", None) is not None and torch.backends.mps.is_available():
DEVICE = "mps" # Apple Silicon
else:
DEVICE = "cpu"
print(f"Using device: {DEVICE}")
# ---------------------------------------------------------
# 1. Tokenizer
# ---------------------------------------------------------
logging.getLogger("transformers.tokenization_utils_base").setLevel(logging.ERROR)
tokenizer = AutoTokenizer.from_pretrained(
MODEL_PATH,
trust_remote_code=True,
)
# ---------------------------------------------------------
# 2. Model
# ---------------------------------------------------------
dtype = torch.bfloat16 if DEVICE != "cpu" else torch.float32
model = AutoModelForCausalLM.from_pretrained(
MODEL_PATH,
dtype=dtype,
device_map="auto",
trust_remote_code=True,
)
model.eval()
# ---------------------------------------------------------
# 3. Prompt
# ---------------------------------------------------------
prompt = "Зачем поступать в КГТУ на специальность «Прикладная информатика»?"
messages = [
{
"role": "system",
"content": (
"Ты виртуальный ассистент университетского комплекса КГТУ. "
"Отвечай кратко и по существу."
)
},
{
"role": "user",
"content": prompt
},
]
# ---------------------------------------------------------
# 4. Chat template
# ---------------------------------------------------------
try:
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
except TypeError:
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
# ---------------------------------------------------------
# 5. Tokenize
# ---------------------------------------------------------
model_inputs = tokenizer(
[text],
return_tensors="pt",
padding=True,
).to(model.device)
# ---------------------------------------------------------
# 6. Generation
# ---------------------------------------------------------
with torch.inference_mode():
generated_ids = model.generate(
**model_inputs,
max_new_tokens=250,
do_sample=True,
temperature=0.7,
top_p=0.8,
top_k=20,
min_p=0.0,
repetition_penalty=1.15,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=(
tokenizer.pad_token_id
if tokenizer.pad_token_id is not None
else tokenizer.eos_token_id
),
use_cache=True,
)
generated_ids = generated_ids[:, model_inputs.input_ids.shape[1]:]
# ---------------------------------------------------------
# 7. Decode
# ---------------------------------------------------------
response = tokenizer.decode(
generated_ids[0],
skip_special_tokens=True,
).strip()
print("=== RESPONSE ===")
print(response)
print("================")
Для более точных ответов используйте RAG и/или вызов инструментов.
Подробнее о модели можно будет узнать на конференциях и в статьях. (Будут добавляться в описание карточки)
English
KSTU_T-lite-2.1 is a model fine-tuned from T-lite-it-2.1 by T-Bank. It is designed to assist in retrieving and providing information about the KSTU university complex in Russia. The university complex comprises four educational institutions: Kaliningrad State Technical University (KSTU), the Baltic Fishing Fleet State Academy (BFFSA), the Kaliningrad Marine Fishing College (KMFC), and the St. Petersburg Marine Fishing College (SPMFC).
The model was trained in two stages: sentence completion (2 epochs) and instruction tuning (3 epochs). And it knows about events up to the second half of 2025.
Metrics:
| Metrics | Stage 1 (2 epochs) | Stage 2 (3 epochs) |
|---|---|---|
| ROUGE-1 | 0.0406 | 0.0602 |
| ROUGE-2 | 0.0037 | 0.0238 |
| ROUGE-L | 0.0343 | 0.0596 |
| PRECISION | 0.1314 | 0.1798 |
| RECALL | 0.1372 | 0.2138 |
| F1 | 0.1203 | 0.1774 |
Comparison with another project from Donetsk State University:
| Metrics | KSTU_T-lite-2.1 5 epochs |
Donetsk State University Assistant LLaMA-3.1-8b 25 epochs |
|---|---|---|
| ROUGE-1 | 0.0602 | 0.1331 |
| ROUGE-2 | 0.0238 | 0.0721 |
| ROUGE-L | 0.0596 | 0.1320 |
| PRECISION | 0.1798 | - |
| RECALL | 0.2138 | - |
| F1 | 0.1774 | - |
Usage: You can use this model, its quantized versions, or the interactive space. Quantized versions have been created but have not yet been added to the site; the description will be updated once they are available. An interactive space is planned but has not yet been created.
Python:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
import logging
import warnings
torch.manual_seed(42)
MODEL_PATH = "./KSTU_T-lite-2.1"
if torch.cuda.is_available():
DEVICE = "cuda"
elif getattr(torch.backends, "mps", None) is not None and torch.backends.mps.is_available():
DEVICE = "mps" # Apple Silicon
else:
DEVICE = "cpu"
print(f"Using device: {DEVICE}")
# ---------------------------------------------------------
# 1. Tokenizer
# ---------------------------------------------------------
logging.getLogger("transformers.tokenization_utils_base").setLevel(logging.ERROR)
tokenizer = AutoTokenizer.from_pretrained(
MODEL_PATH,
trust_remote_code=True,
)
# ---------------------------------------------------------
# 2. Model
# ---------------------------------------------------------
dtype = torch.bfloat16 if DEVICE != "cpu" else torch.float32
model = AutoModelForCausalLM.from_pretrained(
MODEL_PATH,
dtype=dtype,
device_map="auto",
trust_remote_code=True,
)
model.eval()
# ---------------------------------------------------------
# 3. Prompt
# ---------------------------------------------------------
prompt = "Зачем поступать в КГТУ на специальность «Прикладная информатика»?"
messages = [
{
"role": "system",
"content": (
"Ты виртуальный ассистент университетского комплекса КГТУ. "
"Отвечай кратко и по существу."
)
},
{
"role": "user",
"content": prompt
},
]
# ---------------------------------------------------------
# 4. Chat template
# ---------------------------------------------------------
try:
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
except TypeError:
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
# ---------------------------------------------------------
# 5. Tokenize
# ---------------------------------------------------------
model_inputs = tokenizer(
[text],
return_tensors="pt",
padding=True,
).to(model.device)
# ---------------------------------------------------------
# 6. Generation
# ---------------------------------------------------------
with torch.inference_mode():
generated_ids = model.generate(
**model_inputs,
max_new_tokens=250,
do_sample=True,
temperature=0.7,
top_p=0.8,
top_k=20,
min_p=0.0,
repetition_penalty=1.15,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=(
tokenizer.pad_token_id
if tokenizer.pad_token_id is not None
else tokenizer.eos_token_id
),
use_cache=True,
)
generated_ids = generated_ids[:, model_inputs.input_ids.shape[1]:]
# ---------------------------------------------------------
# 7. Decode
# ---------------------------------------------------------
response = tokenizer.decode(
generated_ids[0],
skip_special_tokens=True,
).strip()
print("=== RESPONSE ===")
print(response)
print("================")
For more accurate answers, use RAG and/or tool calling.
More information about the model will be available at conferences and in articles. (These will be added to the card description.)
- Downloads last month
- -