Abhishekcr448 commited on
Commit
ea5a4c7
·
verified ·
1 Parent(s): fccc821

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -50
README.md CHANGED
@@ -11,21 +11,44 @@ tags:
11
  - text-generation-inference
12
  - text-completion
13
  - gpt2
14
- - PyTorch
15
  library_name: transformers
16
  ---
17
  # Model Card for Tiny Hinglish-Chat-21M
18
-
19
  A Tiny Hinglish Speaking text completion model. It can carry out conversations on everyday-life topics in Hinglish. Try it now through its Hugging Face Space!
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  ## Model Details
22
 
23
  ### Model Description
24
-
25
  The **Tiny Hinglish-Chat-21M** is a small conversational text generation model trained on a Hinglish-based conversation dataset. It can generate responses in Hinglish (a mixture of Hindi and English) for everyday conversation topics. The model is based on the GPT-2 architecture, making it suitable for text completion tasks in a conversational setting.
26
-
27
  The model was trained using a synthetically created Hinglish dataset with GPT4o-mini and fine-tuned to provide responses that mimic casual dialogues between two people. This model is designed for edge devices, ensuring it remains lightweight and fast while maintaining response relevance.
28
-
29
  The complete process and code used to build this model can be found in my GitHub repository: [Tiny-Hinglish-Chat-21M-Scripts](https://github.com/Abhishekcr448/Tiny-Hinglish-Chat-21M-Scripts)
30
 
31
  - **Developed by:** [Abhishek Khatri](https://huggingface.co/Abhishekcr448)
@@ -33,69 +56,34 @@ The complete process and code used to build this model can be found in my GitHub
33
  - **License:** MIT
34
 
35
  ### Model Architecture
36
-
37
  This model is built on the GPT-2 architecture, a well-known transformer-based model designed for generating coherent text in a variety of contexts. The model was fine-tuned on a dataset of Hinglish conversations, ensuring it understands both Hindi and English mixed text.
38
 
39
  ### Performance
40
-
41
  - **Language Support:** Hinglish (a mix of Hindi and English)
42
  - **Primary Use Case:** Text completion for conversational chatbots
43
  - **Model Size:** ~21 million parameters
44
 
45
  ## Uses
46
-
47
  This model can be used for generating text in Hinglish, making it ideal for small-scale chatbots or applications that need conversational models with limited computational resources. It is particularly suitable for edge devices where both the model size and response time matter.
48
 
49
  ### Direct Use
50
-
51
  You can directly use the model through Hugging Face's Space or by integrating it into your own application. Currently, there is no live implementation available, but you can easily implement it for use in chatbots or conversational systems.
52
 
53
  ## Bias, Risks, and Limitations
54
-
55
  Like any AI model, this model may sometimes generate irrelevant or biased outputs. Since it was trained on synthetic data generated by GPT4o-mini, there may be instances where the outputs reflect the biases inherent in that data. Users should always review generated text to ensure its relevance and appropriateness.
56
 
57
  ### Risks
58
-
59
  - The model may sometimes provide contextually incorrect or biased responses.
60
  - Hinglish being a non-standard language mixture, some responses may be difficult for users unfamiliar with the language blend.
61
 
62
  ### Recommendations
63
-
64
  It is advised to monitor and review the generated outputs before deployment, especially in sensitive applications, to avoid any undesirable or inappropriate responses.
65
 
66
- ## How to Get Started with the Model
67
-
68
- To get started with the model, simply run the below python code
69
-
70
- ```python
71
- import torch
72
- from transformers import AutoTokenizer, AutoModelForCausalLM
73
-
74
- # Load the model and tokenizer
75
- model, tokenizer = (AutoModelForCausalLM.from_pretrained("Abhishekcr448/Tiny-Hinglish-Chat-21M")
76
- .to("cuda" if torch.cuda.is_available() else "cpu"),
77
- AutoTokenizer.from_pretrained("Abhishekcr448/Tiny-Hinglish-Chat-21M"))
78
-
79
- # Function to generate text
80
- def generate_text(prompt):
81
- inputs = tokenizer(prompt, return_tensors='pt').to(model.device)
82
- print(tokenizer.decode(model.generate(inputs['input_ids'],
83
- max_length=inputs['input_ids'].shape[-1] + 25,
84
- no_repeat_ngram_size=2, temperature=0.8,
85
- top_k=50, top_p=0.9, do_sample=True)[0],
86
- skip_special_tokens=True))
87
-
88
- while (prompt := input("Enter prompt ('exit' to quit): ").lower()) != "exit":
89
- generate_text(prompt)
90
- ```
91
-
92
  ## Training Details
93
-
94
  The training process, including data collection, preprocessing, and model fine-tuning, is explained in the following GitHub repository: [Tiny-Hinglish-Chat-21M-Scripts](https://github.com/Abhishekcr448/Tiny-Hinglish-Chat-21M). The model was trained on a custom Hinglish dataset created using GPT4o-mini.
95
 
96
 
97
  ## Environmental Impact
98
-
99
  The model was trained on a private infrastructure using an NVIDIA RTX 4090 GPU, and the total computation lasted for about 10 hours. The carbon emissions during the training were calculated using the Machine Learning CO₂ Impact calculator.
100
 
101
  Hardware Type: RTX 4090
@@ -108,17 +96,14 @@ These values were calculated using the MLCO2 Impact Calculator presented in the
108
  ## Technical Specifications
109
 
110
  ### Model Architecture and Objective
111
-
112
  **Architecture**: GPT-2 (small model)
113
  **Objective**: Text generation based on conversational prompts in Hinglish
114
 
115
  ### Software
116
-
117
  **Frameworks Used**: PyTorch, Transformers (Hugging Face)
118
  **Environment**: Python 3.8, torch 2.5.1, transformers 4.46.3
119
 
120
  ## Citation
121
-
122
  If you use this model or dataset in your work, please cite the following:
123
 
124
  **BibTeX:**
@@ -132,18 +117,12 @@ If you use this model or dataset in your work, please cite the following:
132
  ```
133
 
134
  **APA:**
135
-
136
  Khatri, A. (2024). Tiny Hinglish-Chat-21M: A Small Hinglish Conversational Model. Retrieved from https://huggingface.co/Abhishekcr448/Tiny-Hinglish-Chat-21M
137
 
138
  ## Glossary
139
-
140
  **Hinglish**: A blend of Hindi and English, widely used in everyday communication in India and surrounding regions. It involves mixing the two languages, often within the same sentence.
141
  **GPT-2**: A transformer-based language model for text generation developed by OpenAI.
142
 
143
- ## More Information [optional]
144
-
145
- For more information about this model, its training process, or related resources, you can check the GitHub repository [Tiny-Hinglish-Chat-21M-Scripts](https://github.com/Abhishekcr448/Tiny-Hinglish-Chat-21M).
146
-
147
- ## Model Card Authors [optional]
148
 
 
149
  **Author**: Abhishek Khatri
 
11
  - text-generation-inference
12
  - text-completion
13
  - gpt2
 
14
  library_name: transformers
15
  ---
16
  # Model Card for Tiny Hinglish-Chat-21M
 
17
  A Tiny Hinglish Speaking text completion model. It can carry out conversations on everyday-life topics in Hinglish. Try it now through its Hugging Face Space!
18
 
19
+ ## More Information
20
+ For more information about this model, its training process, or related resources, you can check the GitHub repository [Tiny-Hinglish-Chat-21M-Scripts](https://github.com/Abhishekcr448/Tiny-Hinglish-Chat-21M).
21
+
22
+ ## How to Get Started with the Model
23
+ To get started with the model, simply run the below Python code
24
+
25
+ ```python
26
+ import torch
27
+ from transformers import AutoTokenizer, AutoModelForCausalLM
28
+
29
+ # Load the model and tokenizer
30
+ model, tokenizer = (AutoModelForCausalLM.from_pretrained("Abhishekcr448/Tiny-Hinglish-Chat-21M")
31
+ .to("cuda" if torch.cuda.is_available() else "cpu"),
32
+ AutoTokenizer.from_pretrained("Abhishekcr448/Tiny-Hinglish-Chat-21M"))
33
+
34
+ # Function to generate text
35
+ def generate_text(prompt):
36
+ inputs = tokenizer(prompt, return_tensors='pt').to(model.device)
37
+ print(tokenizer.decode(model.generate(inputs['input_ids'],
38
+ max_length=inputs['input_ids'].shape[-1] + 25,
39
+ no_repeat_ngram_size=2, temperature=0.8,
40
+ top_k=50, top_p=0.9, do_sample=True)[0],
41
+ skip_special_tokens=True))
42
+
43
+ while (prompt := input("Enter prompt ('exit' to quit): ").lower()) != "exit":
44
+ generate_text(prompt)
45
+ ```
46
+
47
  ## Model Details
48
 
49
  ### Model Description
 
50
  The **Tiny Hinglish-Chat-21M** is a small conversational text generation model trained on a Hinglish-based conversation dataset. It can generate responses in Hinglish (a mixture of Hindi and English) for everyday conversation topics. The model is based on the GPT-2 architecture, making it suitable for text completion tasks in a conversational setting.
 
51
  The model was trained using a synthetically created Hinglish dataset with GPT4o-mini and fine-tuned to provide responses that mimic casual dialogues between two people. This model is designed for edge devices, ensuring it remains lightweight and fast while maintaining response relevance.
 
52
  The complete process and code used to build this model can be found in my GitHub repository: [Tiny-Hinglish-Chat-21M-Scripts](https://github.com/Abhishekcr448/Tiny-Hinglish-Chat-21M-Scripts)
53
 
54
  - **Developed by:** [Abhishek Khatri](https://huggingface.co/Abhishekcr448)
 
56
  - **License:** MIT
57
 
58
  ### Model Architecture
 
59
  This model is built on the GPT-2 architecture, a well-known transformer-based model designed for generating coherent text in a variety of contexts. The model was fine-tuned on a dataset of Hinglish conversations, ensuring it understands both Hindi and English mixed text.
60
 
61
  ### Performance
 
62
  - **Language Support:** Hinglish (a mix of Hindi and English)
63
  - **Primary Use Case:** Text completion for conversational chatbots
64
  - **Model Size:** ~21 million parameters
65
 
66
  ## Uses
 
67
  This model can be used for generating text in Hinglish, making it ideal for small-scale chatbots or applications that need conversational models with limited computational resources. It is particularly suitable for edge devices where both the model size and response time matter.
68
 
69
  ### Direct Use
 
70
  You can directly use the model through Hugging Face's Space or by integrating it into your own application. Currently, there is no live implementation available, but you can easily implement it for use in chatbots or conversational systems.
71
 
72
  ## Bias, Risks, and Limitations
 
73
  Like any AI model, this model may sometimes generate irrelevant or biased outputs. Since it was trained on synthetic data generated by GPT4o-mini, there may be instances where the outputs reflect the biases inherent in that data. Users should always review generated text to ensure its relevance and appropriateness.
74
 
75
  ### Risks
 
76
  - The model may sometimes provide contextually incorrect or biased responses.
77
  - Hinglish being a non-standard language mixture, some responses may be difficult for users unfamiliar with the language blend.
78
 
79
  ### Recommendations
 
80
  It is advised to monitor and review the generated outputs before deployment, especially in sensitive applications, to avoid any undesirable or inappropriate responses.
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  ## Training Details
 
83
  The training process, including data collection, preprocessing, and model fine-tuning, is explained in the following GitHub repository: [Tiny-Hinglish-Chat-21M-Scripts](https://github.com/Abhishekcr448/Tiny-Hinglish-Chat-21M). The model was trained on a custom Hinglish dataset created using GPT4o-mini.
84
 
85
 
86
  ## Environmental Impact
 
87
  The model was trained on a private infrastructure using an NVIDIA RTX 4090 GPU, and the total computation lasted for about 10 hours. The carbon emissions during the training were calculated using the Machine Learning CO₂ Impact calculator.
88
 
89
  Hardware Type: RTX 4090
 
96
  ## Technical Specifications
97
 
98
  ### Model Architecture and Objective
 
99
  **Architecture**: GPT-2 (small model)
100
  **Objective**: Text generation based on conversational prompts in Hinglish
101
 
102
  ### Software
 
103
  **Frameworks Used**: PyTorch, Transformers (Hugging Face)
104
  **Environment**: Python 3.8, torch 2.5.1, transformers 4.46.3
105
 
106
  ## Citation
 
107
  If you use this model or dataset in your work, please cite the following:
108
 
109
  **BibTeX:**
 
117
  ```
118
 
119
  **APA:**
 
120
  Khatri, A. (2024). Tiny Hinglish-Chat-21M: A Small Hinglish Conversational Model. Retrieved from https://huggingface.co/Abhishekcr448/Tiny-Hinglish-Chat-21M
121
 
122
  ## Glossary
 
123
  **Hinglish**: A blend of Hindi and English, widely used in everyday communication in India and surrounding regions. It involves mixing the two languages, often within the same sentence.
124
  **GPT-2**: A transformer-based language model for text generation developed by OpenAI.
125
 
 
 
 
 
 
126
 
127
+ ## Model Card Authors
128
  **Author**: Abhishek Khatri