🚀 Tiny Hinglish-Chat-21M
A Tiny Hinglish Speaking text completion model that can carry out conversations on everyday-life topics. Try it through its Hugging Face Space!
🚀 Quick Start
To get started with the model, simply run the below Python code
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model, tokenizer = (AutoModelForCausalLM.from_pretrained("Abhishekcr448/Tiny-Hinglish-Chat-21M")
.to("cuda" if torch.cuda.is_available() else "cpu"),
AutoTokenizer.from_pretrained("Abhishekcr448/Tiny-Hinglish-Chat-21M"))
def generate_text(prompt):
inputs = tokenizer(prompt, return_tensors='pt').to(model.device)
output = model.generate(inputs['input_ids'],
max_length=inputs['input_ids'].shape[-1] + 25,
no_repeat_ngram_size=2, temperature=0.8,
top_k=50, top_p=0.9, do_sample=True)
return tokenizer.decode(output[0], skip_special_tokens=True)
prompt = 'kya kar rahe ho'
print(generate_text(prompt))
Output
kya kar rahe ho bas yaar ghar pe hi hoon main toh kabhi kabhi itna kaam karta hoon ki bore ho jata hoon
✨ Features
- Conversational Text Generation: Can generate responses in Hinglish for everyday conversation topics.
- Lightweight and Fast: Designed for edge devices, maintaining response relevance while being lightweight.
- Based on GPT - 2: Built on the well - known GPT - 2 architecture, suitable for text completion tasks in a conversational setting.
📚 Documentation
Model Details
Model Description
The Tiny Hinglish-Chat-21M is a small conversational text generation model. It was trained on a Hinglish-based conversation dataset and can generate Hinglish responses for everyday conversation topics. Based on the GPT - 2 architecture, it's suitable for text completion in a conversational setting.
The model was trained using a synthetically created Hinglish dataset with GPT4o - mini and fine - tuned to mimic casual dialogues. It's designed for edge devices, ensuring light weight, speed, and relevant responses.
The complete process and code used to build this model can be found in my GitHub repository: Tiny-Hinglish-Chat-21M-Scripts
- Developed by: Abhishek Khatri
- Model Type: Text - to - Text Generation (Conversational AI)
- License: MIT
Model Architecture
This model is built on the GPT - 2 architecture, a well - known transformer - based model for generating coherent text in various contexts. It was fine - tuned on a dataset of Hinglish conversations, enabling it to understand mixed Hindi and English text.
Performance
- Language Support: Hinglish (a mix of Hindi and English)
- Primary Use Case: Text completion for conversational chatbots
- Model Size: ~21 million parameters
Uses
This model can be used for generating Hinglish text, making it ideal for small - scale chatbots or applications with limited computational resources. It's particularly suitable for edge devices where model size and response time matter.
Direct Use
You can directly use the model through Hugging Face's Space or integrate it into your own application. Currently, there is no live implementation available, but you can easily implement it for chatbots or conversational systems.
Bias, Risks, and Limitations
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.
Risks
- The model may sometimes provide contextually incorrect or biased responses.
- Hinglish being a non - standard language mixture, some responses may be difficult for users unfamiliar with the language blend.
Recommendations
It is advised to monitor and review the generated outputs before deployment, especially in sensitive applications, to avoid any undesirable or inappropriate responses.
Training Details
The training process, including data collection, preprocessing, and model fine - tuning, is explained in the following GitHub repository: Tiny-Hinglish-Chat-21M-Scripts. The model was trained on a custom Hinglish dataset created using GPT4o - mini.
Environmental Impact
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.
Property |
Details |
Hardware Type |
RTX 4090 |
Hours used |
~10 hours |
Cloud Provider |
Vast.ai |
Compute Region |
Germany |
Carbon Emitted |
1.3 kg CO₂ (estimated) |
These values were calculated using the MLCO2 Impact Calculator presented in the paper by Lacoste et al. (2019).
Technical Specifications
Model Architecture and Objective
- Architecture: GPT - 2 (small model)
- Objective: Text generation based on conversational prompts in Hinglish
Software
- Frameworks Used: PyTorch, Transformers (Hugging Face)
- Environment: Python 3.8, torch 2.5.1, transformers 4.46.3
Citation
If you use this model or dataset in your work, please cite the following:
BibTeX:
@misc{Tiny-Hinglish-Chat-21M,
author = {Abhishek Khatri},
title = {Tiny Hinglish-Chat-21M: A Small Hinglish Conversational Model},
year = {2024},
url = {https://huggingface.co/Abhishekcr448/Tiny-Hinglish-Chat-21M},
}
APA:
Khatri, A. (2024). Tiny Hinglish - Chat - 21M: A Small Hinglish Conversational Model. Retrieved from https://huggingface.co/Abhishekcr448/Tiny-Hinglish-Chat-21M
Glossary
- 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.
- GPT - 2: A transformer - based language model for text generation developed by OpenAI.
Model Card Authors
📄 License
This model is released under the MIT license.