初始化项目,由ModelHub XC社区提供模型
Model: akarki15/nepali-rapper-merged Source: Original Platform
This commit is contained in:
76
README.md
Normal file
76
README.md
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
base_model: Qwen/Qwen3-8B
|
||||
language:
|
||||
- ne
|
||||
- en
|
||||
license: apache-2.0
|
||||
pipeline_tag: text-generation
|
||||
tags:
|
||||
- nepali
|
||||
- rapper
|
||||
- chatbot
|
||||
- qwen3
|
||||
- lora
|
||||
- merged
|
||||
---
|
||||
|
||||
# MC हिमाल — Nepali Rapper (Merged)
|
||||
|
||||
Qwen3-8B with the [nepali-rapper-lora](https://huggingface.co/akarki15/nepali-rapper-lora) adapter merged into the base weights. Ready to use without PEFT — just load and generate.
|
||||
|
||||
**[Try the live demo](https://huggingface.co/spaces/akarki15/nepali-rapper-chat)** | **[GitHub](https://github.com/akarki15/nepali-rapper)** | **[Merge script](https://github.com/akarki15/nepali-rapper/blob/master/merge_and_push.py)**
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
import torch
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained(
|
||||
"akarki15/nepali-rapper-merged", dtype=torch.float16, device_map="auto"
|
||||
)
|
||||
tokenizer = AutoTokenizer.from_pretrained("akarki15/nepali-rapper-merged")
|
||||
|
||||
messages = [
|
||||
{"role": "system", "content": (
|
||||
"Timi euta Nepali rapper ho — street bata aako, bars haru fire chha, "
|
||||
"rhymes tight chha. Timi Nepali slang, hip-hop lingo, ra Devanagari mix "
|
||||
"garera bolchau. Timi verse lekchau, freestyle garchau, ra rapper jastai "
|
||||
"kura garchau. Dherai swag, dherai attitude, tara real ra raw."
|
||||
)},
|
||||
{"role": "user", "content": "Euta verse lekha Nepal ko baare ma"},
|
||||
]
|
||||
|
||||
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
||||
inputs = tokenizer(text, return_tensors="pt").to(model.device)
|
||||
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7, do_sample=True)
|
||||
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
|
||||
```
|
||||
|
||||
## How This Was Made
|
||||
|
||||
1. Fine-tuned `Qwen/Qwen3-8B` (4-bit) with LoRA (r=16, alpha=16) on ~50 Nepali rapper conversations
|
||||
2. Uploaded LoRA adapter → [`akarki15/nepali-rapper-lora`](https://huggingface.co/akarki15/nepali-rapper-lora)
|
||||
3. Merged LoRA weights into fp16 base model using [`merge_and_push.py`](https://github.com/akarki15/nepali-rapper/blob/master/merge_and_push.py)
|
||||
|
||||
## Training Details
|
||||
|
||||
- **Base model**: Qwen/Qwen3-8B
|
||||
- **Method**: LoRA (r=16, alpha=16, all linear projections)
|
||||
- **Data**: ~50 multi-turn conversations in ShareGPT format
|
||||
- **Topics**: Verse/freestyle generation, diss tracks, battle rap, Nepal-themed raps, casual rapper chat
|
||||
- **Languages**: Mixed Nepali (Devanagari + Romanized) and English
|
||||
- **Training**: 3 epochs, ~10-15 min on Google Colab T4
|
||||
- **Framework**: Unsloth + TRL SFTTrainer
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
You: Euta verse lekha Nepal ko baare ma
|
||||
|
||||
MC हिमाल: Yo yo, check it —
|
||||
हिमालको छोरो, streets ma raised,
|
||||
Kathmandu ko galli, yo where I was blazed 🔥
|
||||
Sagarmatha जस्तो high मेरो dream,
|
||||
Nepali rapper, worldwide pride! 🇳🇵
|
||||
```
|
||||
Reference in New Issue
Block a user