Text Generation
Transformers
Safetensors
Turkish
gpt2
mathematics
gsm8k
turkish
sft
dpo
text-generation-inference
Instructions to use OnurAkyar/Cosmos-Math-Gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OnurAkyar/Cosmos-Math-Gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OnurAkyar/Cosmos-Math-Gpt2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OnurAkyar/Cosmos-Math-Gpt2") model = AutoModelForCausalLM.from_pretrained("OnurAkyar/Cosmos-Math-Gpt2") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OnurAkyar/Cosmos-Math-Gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OnurAkyar/Cosmos-Math-Gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OnurAkyar/Cosmos-Math-Gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OnurAkyar/Cosmos-Math-Gpt2
- SGLang
How to use OnurAkyar/Cosmos-Math-Gpt2 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 "OnurAkyar/Cosmos-Math-Gpt2" \ --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": "OnurAkyar/Cosmos-Math-Gpt2", "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 "OnurAkyar/Cosmos-Math-Gpt2" \ --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": "OnurAkyar/Cosmos-Math-Gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OnurAkyar/Cosmos-Math-Gpt2 with Docker Model Runner:
docker model run hf.co/OnurAkyar/Cosmos-Math-Gpt2
Update README.md
Browse files
README.md
CHANGED
|
@@ -15,19 +15,19 @@ datasets:
|
|
| 15 |
- malhajar/gsm8k-tr
|
| 16 |
---
|
| 17 |
|
| 18 |
-
# Cosmos-
|
| 19 |
|
| 20 |
Bu model, Türkçe matematik problemlerini adım adım mantık yürüterek (Chain of Thought) çözmek için geliştirilmiştir. Model ilk olarak next token prediction ile pre-training yapılmıştır.
|
| 21 |
2.adım olarak Sft uygulanmış ve son olarak Dpo algoritması uygulanarak fine-tuning işlemleri yapılmıştır.
|
| 22 |
|
| 23 |
**ytu-ce-cosmos/turkish-gpt2-medium** taban modeli üzerine inşa edilmiş olup, önce **SFT (Supervised Fine-Tuning)** ardından **DPO (Direct Preference Optimization)** yöntemleri ile **GSM8K-TR** veri seti üzerinde eğitilmiştir.
|
| 24 |
|
| 25 |
-
##
|
| 26 |
- İlkokul ve ortaokul seviyesindeki matematik problemlerini çözer.
|
| 27 |
- Problemi parçalara ayırır ve adım adım anlatır.
|
| 28 |
- Sonucu `#### [Cevap]` formatında verir.
|
| 29 |
|
| 30 |
-
##
|
| 31 |
|
| 32 |
Modeli kullanmak için aşağıdaki Python kodunu çalıştırabilirsiniz. Model **"### Soru:"** ve **"### Cevap:"** formatına duyarlıdır.
|
| 33 |
|
|
|
|
| 15 |
- malhajar/gsm8k-tr
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# Cosmos-Math-Gpt2 (Türkçe Matematik Modeli)
|
| 19 |
|
| 20 |
Bu model, Türkçe matematik problemlerini adım adım mantık yürüterek (Chain of Thought) çözmek için geliştirilmiştir. Model ilk olarak next token prediction ile pre-training yapılmıştır.
|
| 21 |
2.adım olarak Sft uygulanmış ve son olarak Dpo algoritması uygulanarak fine-tuning işlemleri yapılmıştır.
|
| 22 |
|
| 23 |
**ytu-ce-cosmos/turkish-gpt2-medium** taban modeli üzerine inşa edilmiş olup, önce **SFT (Supervised Fine-Tuning)** ardından **DPO (Direct Preference Optimization)** yöntemleri ile **GSM8K-TR** veri seti üzerinde eğitilmiştir.
|
| 24 |
|
| 25 |
+
## Model Yetenekleri
|
| 26 |
- İlkokul ve ortaokul seviyesindeki matematik problemlerini çözer.
|
| 27 |
- Problemi parçalara ayırır ve adım adım anlatır.
|
| 28 |
- Sonucu `#### [Cevap]` formatında verir.
|
| 29 |
|
| 30 |
+
## Nasıl Kullanılır?
|
| 31 |
|
| 32 |
Modeli kullanmak için aşağıdaki Python kodunu çalıştırabilirsiniz. Model **"### Soru:"** ve **"### Cevap:"** formatına duyarlıdır.
|
| 33 |
|