Text Generation
Transformers
Safetensors
English
Turkish
gemma2
text-generation-inference
unsloth
trl
Instructions to use atasoglu/gemma-2-2b-tr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use atasoglu/gemma-2-2b-tr with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="atasoglu/gemma-2-2b-tr")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("atasoglu/gemma-2-2b-tr") model = AutoModelForMultimodalLM.from_pretrained("atasoglu/gemma-2-2b-tr") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use atasoglu/gemma-2-2b-tr with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "atasoglu/gemma-2-2b-tr" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "atasoglu/gemma-2-2b-tr", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/atasoglu/gemma-2-2b-tr
- SGLang
How to use atasoglu/gemma-2-2b-tr 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 "atasoglu/gemma-2-2b-tr" \ --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": "atasoglu/gemma-2-2b-tr", "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 "atasoglu/gemma-2-2b-tr" \ --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": "atasoglu/gemma-2-2b-tr", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio
How to use atasoglu/gemma-2-2b-tr with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for atasoglu/gemma-2-2b-tr to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for atasoglu/gemma-2-2b-tr to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for atasoglu/gemma-2-2b-tr to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="atasoglu/gemma-2-2b-tr", max_seq_length=2048, ) - Docker Model Runner
How to use atasoglu/gemma-2-2b-tr with Docker Model Runner:
docker model run hf.co/atasoglu/gemma-2-2b-tr
Update README.md
Browse files
README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
base_model: unsloth/gemma-2-2b-bnb-4bit
|
| 3 |
language:
|
| 4 |
- en
|
|
|
|
| 5 |
license: apache-2.0
|
| 6 |
tags:
|
| 7 |
- text-generation-inference
|
|
@@ -9,6 +10,8 @@ tags:
|
|
| 9 |
- unsloth
|
| 10 |
- gemma2
|
| 11 |
- trl
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# Uploaded model
|
|
@@ -65,4 +68,4 @@ generated_tokens = outputs[:, inputs.input_ids.shape[1]:]
|
|
| 65 |
response = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
| 66 |
print(response)
|
| 67 |
# Output: ['C++ veya Python en iyi seçenektir çünkü bu iki dilde çok sayıda yapay zeka araçları vardır. Bu araçlar, veri analizi, öğrenme algoritmaları ve karar verme süreçlerini kolaylaştırır. Ayrıca, her ikisinin de güçlü bir kütüphanesi olması da önemlidir.']
|
| 68 |
-
```
|
|
|
|
| 2 |
base_model: unsloth/gemma-2-2b-bnb-4bit
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
+
- tr
|
| 6 |
license: apache-2.0
|
| 7 |
tags:
|
| 8 |
- text-generation-inference
|
|
|
|
| 10 |
- unsloth
|
| 11 |
- gemma2
|
| 12 |
- trl
|
| 13 |
+
datasets:
|
| 14 |
+
- myzens/alpaca-turkish-combined
|
| 15 |
---
|
| 16 |
|
| 17 |
# Uploaded model
|
|
|
|
| 68 |
response = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
| 69 |
print(response)
|
| 70 |
# Output: ['C++ veya Python en iyi seçenektir çünkü bu iki dilde çok sayıda yapay zeka araçları vardır. Bu araçlar, veri analizi, öğrenme algoritmaları ve karar verme süreçlerini kolaylaştırır. Ayrıca, her ikisinin de güçlü bir kütüphanesi olması da önemlidir.']
|
| 71 |
+
```
|