Instructions to use ps1x/ha-russian-function-gemma with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ps1x/ha-russian-function-gemma with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ps1x/ha-russian-function-gemma") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ps1x/ha-russian-function-gemma") model = AutoModelForCausalLM.from_pretrained("ps1x/ha-russian-function-gemma") 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
- vLLM
How to use ps1x/ha-russian-function-gemma with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ps1x/ha-russian-function-gemma" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ps1x/ha-russian-function-gemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ps1x/ha-russian-function-gemma
- SGLang
How to use ps1x/ha-russian-function-gemma 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 "ps1x/ha-russian-function-gemma" \ --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": "ps1x/ha-russian-function-gemma", "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 "ps1x/ha-russian-function-gemma" \ --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": "ps1x/ha-russian-function-gemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ps1x/ha-russian-function-gemma with Docker Model Runner:
docker model run hf.co/ps1x/ha-russian-function-gemma
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("ps1x/ha-russian-function-gemma")
model = AutoModelForCausalLM.from_pretrained("ps1x/ha-russian-function-gemma")
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]:]))ha-russian-function-gemma
A specialized fine-tuned version of google/functiongemma-270m-it designed for direct, telegraphic Russian home automation commands.
Model Details
- Architecture: Gemma-2
- Parameters: 270M
- Fine-tuning Focus: Russian Language, Short/Telegraphic commands, Home Assistant Tool Calling.
- Tools Supported:
set_device_state,set_device_value,get_device_status.
Usage Pattern
The model expects a developer role containing the tool definitions and a user role with telegraphic Russian.
Input Example: "включи свет полки"
Expected Output:
<start_function_call>call:set_device_state{entity_id: "light.shelves", service: "turn_on"}<end_function_call>
Training Data
Fine-tuned on a custom dataset of ~1400 Russian home automation scenarios spanning climate, lighting, and sensor queries.
- Downloads last month
- 317
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ps1x/ha-russian-function-gemma") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)