Translation
Transformers
Safetensors
GGUF
English
Hindi
llama
text-generation-inference
hinglish
code-switching
unsloth
trl
lora
conversational
Instructions to use suyash2739/English_to_Hinglish_cmu_hinglish_dog with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use suyash2739/English_to_Hinglish_cmu_hinglish_dog with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="suyash2739/English_to_Hinglish_cmu_hinglish_dog") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("suyash2739/English_to_Hinglish_cmu_hinglish_dog", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use suyash2739/English_to_Hinglish_cmu_hinglish_dog 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 suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M # Run inference directly in the terminal: llama cli -hf suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M # Run inference directly in the terminal: llama cli -hf suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M
Use Docker
docker model run hf.co/suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use suyash2739/English_to_Hinglish_cmu_hinglish_dog with Ollama:
ollama run hf.co/suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use suyash2739/English_to_Hinglish_cmu_hinglish_dog with Docker Model Runner:
docker model run hf.co/suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M
- Lemonade
How to use suyash2739/English_to_Hinglish_cmu_hinglish_dog with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull suyash2739/English_to_Hinglish_cmu_hinglish_dog:Q4_K_M
Run and chat with the model
lemonade run user.English_to_Hinglish_cmu_hinglish_dog-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Update README.md
Browse files
README.md
CHANGED
|
@@ -3,96 +3,60 @@ language:
|
|
| 3 |
- en
|
| 4 |
- hi
|
| 5 |
license: apache-2.0
|
|
|
|
|
|
|
| 6 |
tags:
|
| 7 |
- text-generation-inference
|
| 8 |
-
-
|
| 9 |
-
-
|
|
|
|
| 10 |
- llama
|
|
|
|
| 11 |
- trl
|
| 12 |
-
-
|
|
|
|
| 13 |
base_model: unsloth/llama-3-8b-Instruct-bnb-4bit
|
| 14 |
datasets:
|
| 15 |
- cmu_hinglish_dog
|
| 16 |
- suyash2739/Hinglish
|
| 17 |
---
|
| 18 |
-
# Better model
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
-
|
| 25 |
|
| 26 |
-
#
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
| 29 |
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
-
- Model_Use.ipynb file to use the model
|
| 33 |
-
- Hinglish_train_lamma_3_8b_instruct_.ipynb to see how the model is trained
|
| 34 |
-
|
| 35 |
-
# Inference:
|
| 36 |
-
|
| 37 |
-
```
|
| 38 |
-
!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
|
| 39 |
-
!pip install --no-deps xformers trl peft accelerate bitsandbytes
|
| 40 |
-
```
|
| 41 |
|
| 42 |
```python
|
| 43 |
from unsloth import FastLanguageModel
|
| 44 |
-
import torch
|
| 45 |
-
max_seq_length = 2048
|
| 46 |
-
dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
|
| 47 |
-
load_in_4bit = True # Use 4bit quantization to reduce memory usage. Can be False.
|
| 48 |
|
| 49 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 50 |
-
model_name
|
| 51 |
-
max_seq_length
|
| 52 |
-
dtype
|
| 53 |
-
load_in_4bit
|
| 54 |
)
|
| 55 |
```
|
| 56 |
|
| 57 |
-
```
|
| 58 |
-
prompt = """Translate the input from English to Hinglish to give the response.
|
| 59 |
-
|
| 60 |
-
### Input:
|
| 61 |
-
{}
|
| 62 |
-
|
| 63 |
-
### Response:
|
| 64 |
-
{}"""
|
| 65 |
-
|
| 66 |
-
```
|
| 67 |
-
|
| 68 |
-
```python
|
| 69 |
-
|
| 70 |
-
inputs = tokenizer(
|
| 71 |
-
[
|
| 72 |
-
prompt.format(
|
| 73 |
-
"""This is a fine-tuned Hinglish translation model using Llama 3.""", # input
|
| 74 |
-
"", # output - leave this blank for generation!
|
| 75 |
-
)
|
| 76 |
-
], return_tensors = "pt").to("cuda")
|
| 77 |
-
|
| 78 |
-
from transformers import TextStreamer
|
| 79 |
-
text_streamer = TextStreamer(tokenizer)
|
| 80 |
-
```
|
| 81 |
-
|
| 82 |
-
```python
|
| 83 |
-
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 2048)
|
| 84 |
-
## ye ek fine-tuned Hinglish translation model hai jisme Llama 3 use kiya gaya hai
|
| 85 |
-
|
| 86 |
-
```
|
| 87 |
-
|
| 88 |
-
|
| 89 |
|
| 90 |
-
#
|
| 91 |
|
| 92 |
-
-
|
| 93 |
-
- **License:** apache-2.0
|
| 94 |
-
- **Finetuned from model :** unsloth/llama-3-8b-Instruct-bnb-4bit
|
| 95 |
|
| 96 |
-
|
| 97 |
|
| 98 |
-
|
|
|
|
|
|
|
|
|
| 3 |
- en
|
| 4 |
- hi
|
| 5 |
license: apache-2.0
|
| 6 |
+
library_name: transformers
|
| 7 |
+
pipeline_tag: translation
|
| 8 |
tags:
|
| 9 |
- text-generation-inference
|
| 10 |
+
- hinglish
|
| 11 |
+
- translation
|
| 12 |
+
- code-switching
|
| 13 |
- llama
|
| 14 |
+
- unsloth
|
| 15 |
- trl
|
| 16 |
+
- lora
|
| 17 |
+
- text-generation-inference
|
| 18 |
base_model: unsloth/llama-3-8b-Instruct-bnb-4bit
|
| 19 |
datasets:
|
| 20 |
- cmu_hinglish_dog
|
| 21 |
- suyash2739/Hinglish
|
| 22 |
---
|
|
|
|
| 23 |
|
| 24 |
+
# Llama 3 8B — English → Hinglish (CMU Hinglish DoG variant)
|
| 25 |
|
| 26 |
+
An earlier variant of my English → Hinglish translation work: Llama 3 8B Instruct fine-tuned with QLoRA on a [cleaned version](https://huggingface.co/datasets/suyash2739/Hinglish) of the CMU Hinglish DoG conversational dataset.
|
| 27 |
|
| 28 |
+
> **Looking for the recommended model?** The newer variant trained on a curated news-domain corpus produces more fluent Hinglish: [English_to_Hinglish_fintuned_lamma_3_8b_instruct](https://huggingface.co/suyash2739/English_to_Hinglish_fintuned_lamma_3_8b_instruct).
|
| 29 |
|
| 30 |
+
## Details
|
| 31 |
|
| 32 |
+
- **Base model:** `unsloth/llama-3-8b-Instruct-bnb-4bit`
|
| 33 |
+
- **Method:** QLoRA (4-bit) with Unsloth + HuggingFace TRL
|
| 34 |
+
- **Training data:** [suyash2739/Hinglish](https://huggingface.co/datasets/suyash2739/Hinglish) — cleaned from [cmu_hinglish_dog](https://huggingface.co/datasets/cmu_hinglish_dog) (conversational domain)
|
| 35 |
+
- **License:** Apache 2.0
|
| 36 |
|
| 37 |
+
## How to use
|
| 38 |
|
| 39 |
+
Same interface as the main model:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
```python
|
| 42 |
from unsloth import FastLanguageModel
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 45 |
+
model_name="suyash2739/English_to_Hinglish_cmu_hinglish_dog",
|
| 46 |
+
max_seq_length=2048,
|
| 47 |
+
dtype=None,
|
| 48 |
+
load_in_4bit=True,
|
| 49 |
)
|
| 50 |
```
|
| 51 |
|
| 52 |
+
Prompt format: `Translate the input from English to Hinglish to give the response.` followed by `### Input:` and `### Response:` sections.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
+
## Why two variants?
|
| 55 |
|
| 56 |
+
This model captures conversational, dialogue-style Hinglish (CMU DoG is a document-grounded conversation dataset), while the main model targets news-register Hinglish. Comparing the two illustrates how strongly domain of the parallel corpus shapes code-mixing style in the output.
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
## Limitations
|
| 59 |
|
| 60 |
+
- Conversational-domain training data; formal text may translate awkwardly.
|
| 61 |
+
- Romanized Hinglish only.
|
| 62 |
+
- Inherits base-model and corpus biases.
|