suyash2739 commited on
Commit
1d563c4
·
verified ·
1 Parent(s): 4d3ad25

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -65
README.md CHANGED
@@ -3,96 +3,60 @@ language:
3
  - en
4
  - hi
5
  license: apache-2.0
 
 
6
  tags:
7
  - text-generation-inference
8
- - transformers
9
- - unsloth
 
10
  - llama
 
11
  - trl
12
- - Hinglish
 
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
- I have just deployed a better model than this on [https://huggingface.co/suyash2739/English_to_Hinglish_fintuned_lamma_3_8b_instruct ]
21
 
22
- # Loss Curve
23
 
24
- ![image/png](https://cdn-uploads.huggingface.co/production/uploads/65187b234965add2b08b2990/f-qJHUQGxN9yaXym_5u4V.png)
25
 
26
- # Evaluation Loss
27
 
28
- ![image/png](https://cdn-uploads.huggingface.co/production/uploads/65187b234965add2b08b2990/6VsNF_rgDjXlubd4x8dMk.png)
 
 
 
29
 
 
30
 
31
- # Colab Files:
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 = "suyash2739/English_to_Hinglish_cmu_hinglish_dog",
51
- max_seq_length = max_seq_length,
52
- dtype = dtype,
53
- load_in_4bit = load_in_4bit,
54
  )
55
  ```
56
 
57
- ```python
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
- # Uploaded model
91
 
92
- - **Developed by:** suyash2739
93
- - **License:** apache-2.0
94
- - **Finetuned from model :** unsloth/llama-3-8b-Instruct-bnb-4bit
95
 
96
- This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
97
 
98
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
 
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.