Text Generation
Transformers
Safetensors
Russian
llama
russian
conversational
text-generation-inference
Instructions to use ViorikaAI-org/MicroLlama with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ViorikaAI-org/MicroLlama with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ViorikaAI-org/MicroLlama") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ViorikaAI-org/MicroLlama") model = AutoModelForCausalLM.from_pretrained("ViorikaAI-org/MicroLlama") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ViorikaAI-org/MicroLlama with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ViorikaAI-org/MicroLlama" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ViorikaAI-org/MicroLlama", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ViorikaAI-org/MicroLlama
- SGLang
How to use ViorikaAI-org/MicroLlama 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 "ViorikaAI-org/MicroLlama" \ --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": "ViorikaAI-org/MicroLlama", "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 "ViorikaAI-org/MicroLlama" \ --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": "ViorikaAI-org/MicroLlama", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ViorikaAI-org/MicroLlama with Docker Model Runner:
docker model run hf.co/ViorikaAI-org/MicroLlama
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,69 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- ru
|
| 5 |
+
tags:
|
| 6 |
+
- llama
|
| 7 |
+
- russian
|
| 8 |
+
- conversational
|
| 9 |
+
model-index:
|
| 10 |
+
- name: MicroLLAMA
|
| 11 |
+
results: []
|
| 12 |
+
library_name: transformers
|
| 13 |
+
model_creator: ViorikaAI
|
| 14 |
+
pipeline_tag: text-generation
|
| 15 |
---
|
| 16 |
+
|
| 17 |
+
# 🦙 MicroLlama
|
| 18 |
+
**Эксперементальная микро-модель**
|
| 19 |
+
|
| 20 |
+
# Подробнее:
|
| 21 |
+
|
| 22 |
+
## ⚙️ Детали модели
|
| 23 |
+
- **Архитектура: LLAMA**
|
| 24 |
+
- **Параметры: 3M**
|
| 25 |
+
- **Язык: Русский**
|
| 26 |
+
- **Лицения: MIT**
|
| 27 |
+
|
| 28 |
+
## 🏋️ Детали Тренировки
|
| 29 |
+
- **Датасет:** ``
|
| 30 |
+
- **Железо:** **ОДНА** NVIDIA **GEFORCE RTX 5060 TI** (16GB VRAM)
|
| 31 |
+
- **Эпохи:** - 18
|
| 32 |
+
- **СРЕДНИЙ LOSS:** 0.4349
|
| 33 |
+
- **Оптимизатор:** 5e-4
|
| 34 |
+
- **Контекст:** 32 токена
|
| 35 |
+
|
| 36 |
+
## 🏋️ Использование
|
| 37 |
+
```python
|
| 38 |
+
from transformers import AutoModelForCausalLM, PreTrainedTokenizerFast
|
| 39 |
+
|
| 40 |
+
model_name = "ViorikaAI-org/MicroLlama"
|
| 41 |
+
tokenizer = PreTrainedTokenizerFast.from_pretrained(model_name)
|
| 42 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 43 |
+
|
| 44 |
+
model.eval()
|
| 45 |
+
|
| 46 |
+
prompt = "<s> Привет, как дела? =>"
|
| 47 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 48 |
+
|
| 49 |
+
outputs = model.generate(
|
| 50 |
+
**inputs,
|
| 51 |
+
max_new_tokens=32,
|
| 52 |
+
temperature=0.7,
|
| 53 |
+
top_k=50,
|
| 54 |
+
top_p=0.9,
|
| 55 |
+
do_sample=True,
|
| 56 |
+
no_repeat_ngram_size=2,
|
| 57 |
+
pad_token_id=tokenizer.pad_token_id,
|
| 58 |
+
eos_token_id=tokenizer.eos_token_id
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
full_text = tokenizer.decode(outputs[0], skip_special_tokens=False)
|
| 62 |
+
answer = full_text.split("=>")[-1].replace("</s>", "").strip()
|
| 63 |
+
|
| 64 |
+
print(f"Ответ модели: {answer}")
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
## 🛜 Наши Соц. Сети
|
| 68 |
+
- **Discord:** https://discord.gg/8JwTv8zj8d , https://discord.gg/7JE7maH6cf
|
| 69 |
+
- **Telegram:** https://t.me/viorika_official
|