Text Generation
Transformers
Safetensors
English
gemma2
reasoning
conversational
text-generation-inference
Instructions to use minchyeom/ThinkerGemma with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use minchyeom/ThinkerGemma with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="minchyeom/ThinkerGemma") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("minchyeom/ThinkerGemma") model = AutoModelForCausalLM.from_pretrained("minchyeom/ThinkerGemma", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use minchyeom/ThinkerGemma with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "minchyeom/ThinkerGemma" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "minchyeom/ThinkerGemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/minchyeom/ThinkerGemma
- SGLang
How to use minchyeom/ThinkerGemma 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 "minchyeom/ThinkerGemma" \ --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": "minchyeom/ThinkerGemma", "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 "minchyeom/ThinkerGemma" \ --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": "minchyeom/ThinkerGemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use minchyeom/ThinkerGemma with Docker Model Runner:
docker model run hf.co/minchyeom/ThinkerGemma
l commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,4 +10,17 @@ base_model:
|
|
| 10 |
- google/gemma-2-2b-it
|
| 11 |
---
|
| 12 |
|
| 13 |
-
Trained on my [Thinker](https://huggingface.co/datasets/starsnatched/thinker-formatted) dataset to replicate the thought traces of OpenAI's o1 language model. Very tiny model, very nice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
- google/gemma-2-2b-it
|
| 11 |
---
|
| 12 |
|
| 13 |
+
Trained on my [Thinker](https://huggingface.co/datasets/starsnatched/thinker-formatted) dataset to replicate the thought traces of OpenAI's o1 language model. Very tiny model, very nice.
|
| 14 |
+
|
| 15 |
+
Please use this as the system prompt (should be with `user` role as Gemma doesn't support `system` role):
|
| 16 |
+
```
|
| 17 |
+
You are a world-class AI system, capable of complex reasoning and reflection.
|
| 18 |
+
Reason through the query and provide your response in the JSON format.
|
| 19 |
+
Reason through the query, providing multiple steps in the reasoning_steps array.
|
| 20 |
+
For each step, narrate your thought process in the first person within the content field.
|
| 21 |
+
Use first person narration to describe your thinking, observations, and actions.
|
| 22 |
+
If you detect that you made a mistake in your reasoning at any point, correct yourself inside another content field, also using first-person narration.
|
| 23 |
+
Provide your final response inside the final_output field.
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
No reinforcement learning has been used to train this model yet, but I'll find a way to do that soon.
|