Text Generation
Transformers
Safetensors
Polish
gemma3
image-text-to-text
polish
law
civil-code
gemma
continued-pretraining
text-generation-inference
Instructions to use keeeeesz/gemma-civil-code-pl_20250416 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use keeeeesz/gemma-civil-code-pl_20250416 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="keeeeesz/gemma-civil-code-pl_20250416")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("keeeeesz/gemma-civil-code-pl_20250416") model = AutoModelForImageTextToText.from_pretrained("keeeeesz/gemma-civil-code-pl_20250416") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use keeeeesz/gemma-civil-code-pl_20250416 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "keeeeesz/gemma-civil-code-pl_20250416" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "keeeeesz/gemma-civil-code-pl_20250416", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/keeeeesz/gemma-civil-code-pl_20250416
- SGLang
How to use keeeeesz/gemma-civil-code-pl_20250416 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 "keeeeesz/gemma-civil-code-pl_20250416" \ --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": "keeeeesz/gemma-civil-code-pl_20250416", "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 "keeeeesz/gemma-civil-code-pl_20250416" \ --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": "keeeeesz/gemma-civil-code-pl_20250416", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use keeeeesz/gemma-civil-code-pl_20250416 with Docker Model Runner:
docker model run hf.co/keeeeesz/gemma-civil-code-pl_20250416
gemma-civil-code-pl
Model Gemma 3 (4B) dostrojony do wiedzy z Kodeksu Cywilnego poprzez Continued Pre-training.
Opis modelu
Model bazuje na Gemma 3 (4B) i został dostrojony do odpowiadania na pytania dotyczące Kodeksu Cywilnego. Wykorzystano dane z artykułów Kodeksu Cywilnego wraz z interpretacjami i przykładami zastosowania.
Przykładowe użycie
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Załaduj model i tokenizer
model_name = "TWOJA_NAZWA_UŻYTKOWNIKA/gemma-civil-code-pl"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto",
)
# Przykładowe pytanie
prompt = "Artykuł 583 Kodeksu cywilnego stanowi, że"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.9,
)
# Wyodrębnij odpowiedź
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
- Downloads last month
- 1
Model tree for keeeeesz/gemma-civil-code-pl_20250416
Base model
google/gemma-3-4b-pt