{"id":24455263,"url":"https://github.com/thekartikeyamishra/small-language-model-chatbot","last_synced_at":"2026-04-21T03:31:39.948Z","repository":{"id":271927280,"uuid":"915005924","full_name":"thekartikeyamishra/small-language-model-chatbot","owner":"thekartikeyamishra","description":"The Small Language Model Chatbot is a Python-based interactive chatbot built using Hugging Face's distilGPT-2 model. The chatbot is fun, lightweight, and ideal for demonstrating the capabilities of small-scale language models. It includes interactive widgets for user input and a visual element that tracks and displays .","archived":false,"fork":false,"pushed_at":"2025-01-10T19:10:30.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-31T05:41:02.953Z","etag":null,"topics":["ai","chatbot","distilgpt-2","googlecolab","gpt2","gpt2-chatbot","ipywidgets","jupyter-notebook","llm","python","slm","transformer"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thekartikeyamishra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-10T19:02:16.000Z","updated_at":"2025-08-29T03:03:12.000Z","dependencies_parsed_at":"2025-01-10T20:20:19.701Z","dependency_job_id":"5ed2365a-7d06-4e0a-ae09-3414ac3b1a31","html_url":"https://github.com/thekartikeyamishra/small-language-model-chatbot","commit_stats":null,"previous_names":["thekartikeyamishra/small-language-model-chatbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thekartikeyamishra/small-language-model-chatbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekartikeyamishra%2Fsmall-language-model-chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekartikeyamishra%2Fsmall-language-model-chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekartikeyamishra%2Fsmall-language-model-chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekartikeyamishra%2Fsmall-language-model-chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thekartikeyamishra","download_url":"https://codeload.github.com/thekartikeyamishra/small-language-model-chatbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekartikeyamishra%2Fsmall-language-model-chatbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32075222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T02:38:07.213Z","status":"ssl_error","status_checked_at":"2026-04-21T02:38:06.559Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chatbot","distilgpt-2","googlecolab","gpt2","gpt2-chatbot","ipywidgets","jupyter-notebook","llm","python","slm","transformer"],"created_at":"2025-01-21T02:12:55.418Z","updated_at":"2026-04-21T03:31:39.933Z","avatar_url":"https://github.com/thekartikeyamishra.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Small Language Model Chatbot**\n\n## **Project Overview**\n\nThe **Small Language Model Chatbot** is a Python-based interactive chatbot built using **Hugging Face's `distilGPT-2`** model. The chatbot is fun, lightweight, and ideal for demonstrating the capabilities of small-scale language models. It includes interactive widgets for user input and a visual element that tracks and displays the word count of user inputs over time.\n\nThis project is designed to run seamlessly in **Google Colab**.\n\n---\n\n## **Features**\n\n### 🤖 **Interactive Chatbot**\n- Accepts user input and generates meaningful responses using `distilGPT-2`.\n- Incorporates randomness and creativity in responses through fine-tuned parameters.\n\n### 📊 **Visualization**\n- Displays a bar chart to track the word count of user inputs for each interaction.\n\n### ⚙️ **Enhanced Parameters for Text Generation**\n- **`temperature=0.7`**: Balances creativity and determinism.\n- **`top_p=0.9`**: Uses nucleus sampling to generate high-quality responses.\n- **`min_length=20`**: Ensures meaningful replies.\n\n### 🛡️ **Fallback Mechanism**\n- If the chatbot generates a very short or meaningless response, it provides a fallback message:\n  ```\n  I couldn't think of anything interesting to say! Let's try again.\n  ```\n\n---\n\n## **Installation Instructions**\n\n### 1. Clone the Repository\n```bash\ngit clone https://github.com/thekartikeyamishra/small-language-model-chatbot.git\ncd small-language-model-chatbot\n```\n\n### 2. Install Required Libraries\nMake sure to install the necessary Python libraries:\n```bash\npip install transformers ipywidgets\n```\n\n---\n\n## **How to Use**\n\n1. **Open Google Colab**:\n   - Copy and paste the code into a new Google Colab notebook.\n\n2. **Run the Script**:\n   - Execute the code cells to initialize the chatbot.\n\n3. **Interact with the Chatbot**:\n   - Enter your message in the text input field.\n   - Click the **Send** button to receive the chatbot's reply.\n\n4. **View Visualizations**:\n   - The chatbot displays a bar chart showing the word count of user inputs after each interaction.\n\n---\n\n#### Visualization:\nA bar chart shows the number of words in the user's message for each interaction.\n\n---\n\n## **Potential Enhancements**\n\n1. **Sentiment Analysis**:\n   - Add a sentiment analysis layer to analyze the tone of user messages.\n\n2. **Multilingual Support**:\n   - Integrate pre-trained multilingual models for global audiences.\n\n3. **Save Conversations**:\n   - Allow users to save chat history for later review.\n\n4. **Fine-Tuned Models**:\n   - Use domain-specific datasets to fine-tune the chatbot for specific applications (e.g., customer support, education).\n\n5. **Voice Input/Output**:\n   - Add support for voice-based interactions using libraries like `SpeechRecognition` and `pyttsx3`.\n\n---\n\n## **Use Cases**\n\n- **Learning Tool**:\n  - Explore the capabilities of small language models.\n  - Understand text generation and visualization in NLP.\n\n- **Prototyping**:\n  - Use this chatbot as a starting point for building advanced conversational AI.\n\n- **Fun and Engagement**:\n  - Interact with a lightweight chatbot for entertainment or quick inspiration.\n\n---\n\n## **Contribute**\n\nContributions are welcome! To contribute:\n1. Fork the repository.\n2. Create a new branch:\n   ```bash\n   git checkout -b feature-name\n   ```\n3. Commit your changes:\n   ```bash\n   git commit -m \"Add new feature\"\n   ```\n4. Push to the branch:\n   ```bash\n   git push origin feature-name\n   ```\n5. Open a pull request.\n\n---\n\n## **Support**\n\nIf you enjoy using this project, please:\n- 🌟 Star this repository on GitHub.\n- 🗣️ Share it with your network.\n- 💬 Submit feedback or feature requests.\n\n---\n\n\n## **Acknowledgments**\n\n- **Hugging Face Transformers**: For providing pre-trained models and an intuitive API.\n- **Matplotlib**: For data visualization.\n- **IPyWidgets**: For building an interactive interface.\n\n---\n\nLet me know if you'd like further refinements or additional sections! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekartikeyamishra%2Fsmall-language-model-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthekartikeyamishra%2Fsmall-language-model-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekartikeyamishra%2Fsmall-language-model-chatbot/lists"}