Text Generation
Transformers
TensorBoard
Safetensors
English
gemma3_text
Generated from Trainer
trl
sft
cypher
conversational
text-generation-inference
Instructions to use VoErik/cypher-gemma with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VoErik/cypher-gemma with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="VoErik/cypher-gemma") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("VoErik/cypher-gemma") model = AutoModelForCausalLM.from_pretrained("VoErik/cypher-gemma", 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 VoErik/cypher-gemma with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "VoErik/cypher-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": "VoErik/cypher-gemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/VoErik/cypher-gemma
- SGLang
How to use VoErik/cypher-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 "VoErik/cypher-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": "VoErik/cypher-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 "VoErik/cypher-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": "VoErik/cypher-gemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use VoErik/cypher-gemma with Docker Model Runner:
docker model run hf.co/VoErik/cypher-gemma
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,36 +1,43 @@
|
|
| 1 |
---
|
| 2 |
base_model: google/gemma-3-270m-it
|
| 3 |
library_name: transformers
|
| 4 |
-
model_name:
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
- trl
|
| 8 |
- sft
|
|
|
|
| 9 |
licence: license
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# Model Card
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
This model is a fine-tuned version of [google/gemma-3-270m-it](https://huggingface.co/google/gemma-3-270m-it).
|
| 15 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 16 |
|
| 17 |
## Quick start
|
| 18 |
|
| 19 |
```python
|
| 20 |
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 25 |
print(output["generated_text"])
|
| 26 |
```
|
| 27 |
|
| 28 |
## Training procedure
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
This model was trained with SFT.
|
| 34 |
|
| 35 |
### Framework versions
|
| 36 |
|
|
@@ -42,8 +49,6 @@ This model was trained with SFT.
|
|
| 42 |
|
| 43 |
## Citations
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
| 47 |
Cite TRL as:
|
| 48 |
|
| 49 |
```bibtex
|
|
|
|
| 1 |
---
|
| 2 |
base_model: google/gemma-3-270m-it
|
| 3 |
library_name: transformers
|
| 4 |
+
model_name: cypher-gemma
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
- trl
|
| 8 |
- sft
|
| 9 |
+
- cypher
|
| 10 |
licence: license
|
| 11 |
+
datasets:
|
| 12 |
+
- neo4j/text2cypher-2025v1
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# Model Card
|
| 19 |
+
|
| 20 |
+
This model is a fine-tuned version of [google/gemma-3-270m-it](https://huggingface.co/google/gemma-3-270m-it). Its purpose is turning natural language queries into CypherQueryLanguage.
|
| 21 |
|
|
|
|
| 22 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 23 |
|
| 24 |
## Quick start
|
| 25 |
|
| 26 |
```python
|
| 27 |
from transformers import pipeline
|
| 28 |
+
from schemas import MOVIE_SCHEMA # you need to define this yourself!
|
| 29 |
+
|
| 30 |
+
query = "Which actors played a role in the movie Titanic?"
|
| 31 |
|
| 32 |
+
pipe = pipeline("text-generation", model="VoErik/cypher-gemma", device="cuda")
|
| 33 |
+
output = pipe([{"role": "user", "content": f"Question: {question} \n Schema: {MOVIE_SCHEMA}"}], max_new_tokens=256, return_full_text=False)[0]
|
|
|
|
| 34 |
print(output["generated_text"])
|
| 35 |
```
|
| 36 |
|
| 37 |
## Training procedure
|
| 38 |
|
| 39 |
+
This model was trained with SFT on the text2cypher-2025v1 dataset from Neo4j.
|
| 40 |
+
It was trained for roughly 3500 steps.
|
|
|
|
|
|
|
| 41 |
|
| 42 |
### Framework versions
|
| 43 |
|
|
|
|
| 49 |
|
| 50 |
## Citations
|
| 51 |
|
|
|
|
|
|
|
| 52 |
Cite TRL as:
|
| 53 |
|
| 54 |
```bibtex
|