Text Generation
Transformers
Safetensors
GGUF
Bengali
English
llama
bengali
tagore
poetry
small-model
conversational
text-generation-inference
Instructions to use dbishwarup/TagoreGPT-29M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dbishwarup/TagoreGPT-29M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dbishwarup/TagoreGPT-29M") 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("dbishwarup/TagoreGPT-29M") model = AutoModelForCausalLM.from_pretrained("dbishwarup/TagoreGPT-29M", 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
- llama.cpp
How to use dbishwarup/TagoreGPT-29M with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf dbishwarup/TagoreGPT-29M:F16 # Run inference directly in the terminal: llama cli -hf dbishwarup/TagoreGPT-29M:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf dbishwarup/TagoreGPT-29M:F16 # Run inference directly in the terminal: llama cli -hf dbishwarup/TagoreGPT-29M:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf dbishwarup/TagoreGPT-29M:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf dbishwarup/TagoreGPT-29M:F16
Use Docker
docker model run hf.co/dbishwarup/TagoreGPT-29M:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use dbishwarup/TagoreGPT-29M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dbishwarup/TagoreGPT-29M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dbishwarup/TagoreGPT-29M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dbishwarup/TagoreGPT-29M:F16
- SGLang
How to use dbishwarup/TagoreGPT-29M 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 "dbishwarup/TagoreGPT-29M" \ --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": "dbishwarup/TagoreGPT-29M", "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 "dbishwarup/TagoreGPT-29M" \ --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": "dbishwarup/TagoreGPT-29M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use dbishwarup/TagoreGPT-29M with Ollama:
ollama run hf.co/dbishwarup/TagoreGPT-29M:F16
- Unsloth Desktop
- Docker Model Runner
How to use dbishwarup/TagoreGPT-29M with Docker Model Runner:
docker model run hf.co/dbishwarup/TagoreGPT-29M:F16
- Lemonade
How to use dbishwarup/TagoreGPT-29M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull dbishwarup/TagoreGPT-29M:F16
Run and chat with the model
lemonade run user.TagoreGPT-29M-F16
List all available models
lemonade list
- Atomic Chat
v8: Ollama / LM Studio read the request (language, type, topic) like the app; 4 Ollama recipes
Browse files- Modelfile.poem-bn +17 -0
- Modelfile.poem-en +17 -0
- Modelfile.song-bn +17 -0
- Modelfile → Modelfile.story-en +10 -3
- README.md +24 -11
- chat_template.jinja +1 -1
- tagoregpt-29m-f16.gguf +2 -2
Modelfile.poem-bn
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ./tagoregpt-29m-f16.gguf
|
| 2 |
+
TEMPLATE """<|bn|><|poem|><|tagore|>{{ .Prompt }}
|
| 3 |
+
|
| 4 |
+
বিষয়: {{ .Prompt }}
|
| 5 |
+
দৈর্ঘ্য: মাঝারি
|
| 6 |
+
ছন্দ: মিল
|
| 7 |
+
|
| 8 |
+
"""
|
| 9 |
+
PARAMETER stop "</s>"
|
| 10 |
+
PARAMETER stop "<|request|>"
|
| 11 |
+
PARAMETER temperature 0.75
|
| 12 |
+
PARAMETER top_k 40
|
| 13 |
+
PARAMETER top_p 0.95
|
| 14 |
+
PARAMETER min_p 0.02
|
| 15 |
+
PARAMETER repeat_penalty 1.3
|
| 16 |
+
PARAMETER repeat_last_n 256
|
| 17 |
+
PARAMETER num_ctx 1024
|
Modelfile.poem-en
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ./tagoregpt-29m-f16.gguf
|
| 2 |
+
TEMPLATE """<|en|><|poem|><|tagore|>{{ .Prompt }}
|
| 3 |
+
|
| 4 |
+
About: {{ .Prompt }}
|
| 5 |
+
Length: medium
|
| 6 |
+
Rhyme: yes
|
| 7 |
+
|
| 8 |
+
"""
|
| 9 |
+
PARAMETER stop "</s>"
|
| 10 |
+
PARAMETER stop "<|request|>"
|
| 11 |
+
PARAMETER temperature 0.75
|
| 12 |
+
PARAMETER top_k 40
|
| 13 |
+
PARAMETER top_p 0.95
|
| 14 |
+
PARAMETER min_p 0.02
|
| 15 |
+
PARAMETER repeat_penalty 1.3
|
| 16 |
+
PARAMETER repeat_last_n 256
|
| 17 |
+
PARAMETER num_ctx 1024
|
Modelfile.song-bn
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ./tagoregpt-29m-f16.gguf
|
| 2 |
+
TEMPLATE """<|bn|><|song|><|tagore|>{{ .Prompt }}
|
| 3 |
+
|
| 4 |
+
বিষয়: {{ .Prompt }}
|
| 5 |
+
দৈর্ঘ্য: ছোট
|
| 6 |
+
ছন্দ: মিল
|
| 7 |
+
|
| 8 |
+
"""
|
| 9 |
+
PARAMETER stop "</s>"
|
| 10 |
+
PARAMETER stop "<|request|>"
|
| 11 |
+
PARAMETER temperature 0.7
|
| 12 |
+
PARAMETER top_k 40
|
| 13 |
+
PARAMETER top_p 0.95
|
| 14 |
+
PARAMETER min_p 0.02
|
| 15 |
+
PARAMETER repeat_penalty 1.3
|
| 16 |
+
PARAMETER repeat_last_n 256
|
| 17 |
+
PARAMETER num_ctx 1024
|
Modelfile → Modelfile.story-en
RENAMED
|
@@ -1,9 +1,16 @@
|
|
| 1 |
FROM ./tagoregpt-29m-f16.gguf
|
| 2 |
-
TEMPLATE """<|
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
PARAMETER stop "</s>"
|
|
|
|
| 5 |
PARAMETER temperature 0.8
|
| 6 |
PARAMETER top_k 40
|
| 7 |
-
PARAMETER
|
|
|
|
|
|
|
| 8 |
PARAMETER repeat_last_n 256
|
| 9 |
PARAMETER num_ctx 1024
|
|
|
|
| 1 |
FROM ./tagoregpt-29m-f16.gguf
|
| 2 |
+
TEMPLATE """<|en|><|story|><|tagore|>{{ .Prompt }}
|
| 3 |
+
|
| 4 |
+
About: {{ .Prompt }}
|
| 5 |
+
Length: medium
|
| 6 |
+
|
| 7 |
+
"""
|
| 8 |
PARAMETER stop "</s>"
|
| 9 |
+
PARAMETER stop "<|request|>"
|
| 10 |
PARAMETER temperature 0.8
|
| 11 |
PARAMETER top_k 40
|
| 12 |
+
PARAMETER top_p 0.95
|
| 13 |
+
PARAMETER min_p 0.02
|
| 14 |
+
PARAMETER repeat_penalty 1.3
|
| 15 |
PARAMETER repeat_last_n 256
|
| 16 |
PARAMETER num_ctx 1024
|
README.md
CHANGED
|
@@ -16,21 +16,34 @@ Sir Rabindranath Tagore (Gurudev) was the first non-European to win the Nobel Pr
|
|
| 16 |
|
| 17 |
## How to ask
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
- `write a poem about the river
|
| 22 |
-
- `
|
| 23 |
-
- `একটা কবিতা লেখো বৃষ্টি নিয়ে`
|
| 24 |
-
- `write a letter to a friend in English`
|
| 25 |
|
| 26 |
-
Settings that work well: temperature 0.
|
| 27 |
-
|
| 28 |
|
| 29 |
-
###
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
### Transformers
|
| 36 |
|
|
|
|
| 16 |
|
| 17 |
## How to ask
|
| 18 |
|
| 19 |
+
The model writes from **a topic + hidden labels** (language, type, length, rhyme); it does not read free-form requests.
|
| 20 |
+
The chat template in the GGUF does that step for you, like the TagoreGPT app: it finds the language (Bengali letters or
|
| 21 |
+
not), the type (poem / song / story / letter / essay / play / novel words) and the topic (the request minus
|
| 22 |
+
"write a poem about ..."). Examples that work:
|
| 23 |
|
| 24 |
+
- `write a poem about the river` · `write a song about the rain` · `Write a story about a boatman`
|
| 25 |
+
- `নদী নিয়ে একটা কবিতা লেখো` · `বৃষ্টি নিয়ে একটা গান লেখো`
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
Settings that work well (= the app): temperature 0.75 (poem) / 0.7 (song) / 0.8 (story), top-k 40, top-p 0.95,
|
| 28 |
+
min-p 0.02, **repeat penalty 1.3** (last 256 tokens).
|
| 29 |
|
| 30 |
+
### Ollama: type just the topic
|
| 31 |
|
| 32 |
+
Four ready recipes, one per language + type:
|
| 33 |
+
|
| 34 |
+
```
|
| 35 |
+
ollama create tagoregpt-poem-en -f Modelfile.poem-en # then: ollama run tagoregpt-poem-en "The River"
|
| 36 |
+
ollama create tagoregpt-story-en -f Modelfile.story-en # ollama run tagoregpt-story-en "The old boatman"
|
| 37 |
+
ollama create tagoregpt-poem-bn -f Modelfile.poem-bn # ollama run tagoregpt-poem-bn "নদী"
|
| 38 |
+
ollama create tagoregpt-song-bn -f Modelfile.song-bn # ollama run tagoregpt-song-bn "বৃষ্টি"
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
### LM Studio / llama.cpp
|
| 42 |
+
|
| 43 |
+
- File: `tagoregpt-29m-f16.gguf` (Llama layout, 85 MB). Its chat template reads the request as described above.
|
| 44 |
+
- llama.cpp: `llama-cli -m tagoregpt-29m-f16.gguf -cnv --jinja --temp 0.75 --top-k 40 --repeat-penalty 1.3`
|
| 45 |
+
- English is weaker than Bengali in this version; the TagoreGPT app adds topic guidance and line rules that plain
|
| 46 |
+
llama.cpp / Ollama / LM Studio do not have.
|
| 47 |
|
| 48 |
### Transformers
|
| 49 |
|
chat_template.jinja
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{%
|
|
|
|
| 1 |
+
{%- set c = messages[-1]['content'] | trim -%}{%- set low = c | lower -%}{%- set t = c -%}{%- set t = t | replace('write a song about ', '') -%}{%- set t = t | replace('write a song on ', '') -%}{%- set t = t | replace('write a story about ', '') -%}{%- set t = t | replace('write a story on ', '') -%}{%- set t = t | replace('write a letter about ', '') -%}{%- set t = t | replace('write a letter on ', '') -%}{%- set t = t | replace('write a essay about ', '') -%}{%- set t = t | replace('write a essay on ', '') -%}{%- set t = t | replace('write a play about ', '') -%}{%- set t = t | replace('write a play on ', '') -%}{%- set t = t | replace('write a novel about ', '') -%}{%- set t = t | replace('write a novel on ', '') -%}{%- set t = t | replace('write a poem about ', '') -%}{%- set t = t | replace('write a poem on ', '') -%}{%- set t = t | replace('write an song about ', '') -%}{%- set t = t | replace('write an song on ', '') -%}{%- set t = t | replace('write an story about ', '') -%}{%- set t = t | replace('write an story on ', '') -%}{%- set t = t | replace('write an letter about ', '') -%}{%- set t = t | replace('write an letter on ', '') -%}{%- set t = t | replace('write an essay about ', '') -%}{%- set t = t | replace('write an essay on ', '') -%}{%- set t = t | replace('write an play about ', '') -%}{%- set t = t | replace('write an play on ', '') -%}{%- set t = t | replace('write an novel about ', '') -%}{%- set t = t | replace('write an novel on ', '') -%}{%- set t = t | replace('write an poem about ', '') -%}{%- set t = t | replace('write an poem on ', '') -%}{%- set t = t | replace('Write a song about ', '') -%}{%- set t = t | replace('Write a song on ', '') -%}{%- set t = t | replace('Write a story about ', '') -%}{%- set t = t | replace('Write a story on ', '') -%}{%- set t = t | replace('Write a letter about ', '') -%}{%- set t = t | replace('Write a letter on ', '') -%}{%- set t = t | replace('Write a essay about ', '') -%}{%- set t = t | replace('Write a essay on ', '') -%}{%- set t = t | replace('Write a play about ', '') -%}{%- set t = t | replace('Write a play on ', '') -%}{%- set t = t | replace('Write a novel about ', '') -%}{%- set t = t | replace('Write a novel on ', '') -%}{%- set t = t | replace('Write a poem about ', '') -%}{%- set t = t | replace('Write a poem on ', '') -%}{%- set t = t | replace('Write an song about ', '') -%}{%- set t = t | replace('Write an song on ', '') -%}{%- set t = t | replace('Write an story about ', '') -%}{%- set t = t | replace('Write an story on ', '') -%}{%- set t = t | replace('Write an letter about ', '') -%}{%- set t = t | replace('Write an letter on ', '') -%}{%- set t = t | replace('Write an essay about ', '') -%}{%- set t = t | replace('Write an essay on ', '') -%}{%- set t = t | replace('Write an play about ', '') -%}{%- set t = t | replace('Write an play on ', '') -%}{%- set t = t | replace('Write an novel about ', '') -%}{%- set t = t | replace('Write an novel on ', '') -%}{%- set t = t | replace('Write an poem about ', '') -%}{%- set t = t | replace('Write an poem on ', '') -%}{%- set t = t | replace(' নিয়ে একটা গান লেখো', '') -%}{%- set t = t | replace(' নিয়ে একটা গল্প লেখো', '') -%}{%- set t = t | replace(' নিয়ে একটা চিঠি লেখো', '') -%}{%- set t = t | replace(' নিয়ে একটা প্রবন্ধ লেখো', '') -%}{%- set t = t | replace(' নিয়ে একটা নাটক লেখো', '') -%}{%- set t = t | replace(' নিয়ে একটা উপন্যাস লেখো', '') -%}{%- set t = t | replace(' নিয়ে একটা কবিতা লেখো', '') -%}{%- set t = t | replace(' নিয়ে গান লেখো', '') -%}{%- set t = t | replace(' নিয়ে গল্প লেখো', '') -%}{%- set t = t | replace(' নিয়ে চিঠি লেখো', '') -%}{%- set t = t | replace(' নিয়ে প্রবন্ধ লেখো', '') -%}{%- set t = t | replace(' নিয়ে নাটক লেখো', '') -%}{%- set t = t | replace(' নিয়ে উপন্যাস লেখো', '') -%}{%- set t = t | replace(' নিয়ে কবিতা লেখো', '') -%}{%- if 'া' in c or 'ি' in c or 'ে' in c or 'ো' in c or 'র' in c or 'ক' in c or 'ন' in c or '্' in c -%}{%- if 'গান' in c -%}<|bn|><|song|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}বিষয়: {{ t }}{{ '\n' }}দৈর্ঘ্য: ছোট{{ '\n' }}ছন্দ: মিল{{ '\n' }}{{ '\n' }}{%- elif 'গল্প' in c -%}<|bn|><|story|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}বিষয়: {{ t }}{{ '\n' }}দৈর্ঘ্য: মাঝারি{{ '\n' }}{{ '\n' }}{%- elif 'চিঠি' in c -%}<|bn|><|letter|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}বিষয়: {{ t }}{{ '\n' }}দৈর্ঘ্য: মাঝারি{{ '\n' }}{{ '\n' }}{%- elif 'প্রবন্ধ' in c -%}<|bn|><|essay|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}বিষয়: {{ t }}{{ '\n' }}দৈর্ঘ্য: মাঝারি{{ '\n' }}{{ '\n' }}{%- elif 'নাটক' in c -%}<|bn|><|play|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}বিষয়: {{ t }}{{ '\n' }}দৈর্ঘ্য: মাঝারি{{ '\n' }}{{ '\n' }}{%- elif 'উপন্যাস' in c -%}<|bn|><|novel|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}বিষয়: {{ t }}{{ '\n' }}দৈর্ঘ্য: মাঝারি{{ '\n' }}{{ '\n' }}{%- elif true -%}<|bn|><|poem|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}বিষয়: {{ t }}{{ '\n' }}দৈর্ঘ্য: মাঝারি{{ '\n' }}ছন্দ: মিল{{ '\n' }}{{ '\n' }}{%- endif -%}{%- else -%}{%- if 'song' in low -%}<|en|><|song|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}About: {{ t }}{{ '\n' }}Length: short{{ '\n' }}Rhyme: yes{{ '\n' }}{{ '\n' }}{%- elif 'story' in low -%}<|en|><|story|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}About: {{ t }}{{ '\n' }}Length: medium{{ '\n' }}{{ '\n' }}{%- elif 'letter' in low -%}<|en|><|letter|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}About: {{ t }}{{ '\n' }}Length: medium{{ '\n' }}{{ '\n' }}{%- elif 'essay' in low -%}<|en|><|essay|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}About: {{ t }}{{ '\n' }}Length: medium{{ '\n' }}{{ '\n' }}{%- elif 'play' in low -%}<|en|><|play|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}About: {{ t }}{{ '\n' }}Length: medium{{ '\n' }}{{ '\n' }}{%- elif 'novel' in low -%}<|en|><|novel|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}About: {{ t }}{{ '\n' }}Length: medium{{ '\n' }}{{ '\n' }}{%- elif true -%}<|en|><|poem|><|tagore|>{{ t }}{{ '\n' }}{{ '\n' }}About: {{ t }}{{ '\n' }}Length: medium{{ '\n' }}Rhyme: yes{{ '\n' }}{{ '\n' }}{%- endif -%}{%- endif -%}
|
tagoregpt-29m-f16.gguf
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65f10abb4706655586d8d72ff5b1f4ca5b69b434fc86196e14a0cee72b8879f5
|
| 3 |
+
size 85134144
|