{"id":15131141,"url":"https://github.com/yvandana/chatbot","last_synced_at":"2026-01-18T17:33:29.237Z","repository":{"id":256287629,"uuid":"854841910","full_name":"YVandana/Chatbot","owner":"YVandana","description":"Created a simple chatbot using of LangChain \u0026 Hugging Face","archived":false,"fork":false,"pushed_at":"2024-12-17T00:31:01.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T20:43:09.624Z","etag":null,"topics":["chatbot","huggingface","jupyter-notebook","langchain-python","python","transformers"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YVandana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-09-09T21:40:00.000Z","updated_at":"2024-12-17T00:31:05.000Z","dependencies_parsed_at":"2024-09-10T02:32:10.731Z","dependency_job_id":"d9fb673c-f40a-44b7-8d07-918e9849fc09","html_url":"https://github.com/YVandana/Chatbot","commit_stats":null,"previous_names":["yvandana/chatbot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YVandana%2FChatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YVandana%2FChatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YVandana%2FChatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YVandana%2FChatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YVandana","download_url":"https://codeload.github.com/YVandana/Chatbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399898,"owners_count":20932876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["chatbot","huggingface","jupyter-notebook","langchain-python","python","transformers"],"created_at":"2024-09-26T03:24:04.069Z","updated_at":"2026-01-18T17:33:29.196Z","avatar_url":"https://github.com/YVandana.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chatbot using GPT 2.0\n\n## Overview\nThis project implements a chatbot using the Hugging Face Transformers library and LangChain. It allows users to interact with a conversational AI that can generate responses based on user inputs and maintain conversational context.\n\n## Prerequisites\nBefore running the project, ensure you have the following installed:\n\n- Python 3.10 or higher\n- pip\n\n## Installation\nTo install the required packages, run the following commands:\n\n```bash\n!pip install huggingface_hub\n!pip install transformers\n!pip install langchain\n!pip install chainlit\n```\nAll dependencies will be handled automatically.\n\n## Getting Started\n\n1. Clone the repository or download the project files.\n2.Open a terminal and navigate to the project directory.\n3. Start the Chainlit application by running:\n```\n!chainlit hello\n```\n4. Your app will be available at http://localhost:8000.\n\n## Usage\n1. Import necessary libraries:\n```\nimport os\nimport chainlit as cl\nfrom langchain import HuggingFaceHub, PromptTemplate, LLMChain\nfrom getpass import getpass\n```\n2. Set up your Hugging Face API token:\n```\nHUGGINGFACEHUB_API_TOKEN = getpass(\"Enter your Hugging Face API token: \")\nos.environ['HUGGINGFACEHUB_API_TOKEN'] = HUGGINGFACEHUB_API_TOKEN\n```\n3. Choose a model and create a conversational chain:\n```\nmodel_id = \"gpt2-medium\"  # or other models\nconv_model = HuggingFaceHub(\n    huggingfacehub_api_token=os.environ['HUGGINGFACEHUB_API_TOKEN'],\n    repo_id=model_id,\n    model_kwargs={\"temperature\": 0.8, \"max_new_tokens\": 200}\n)\n```\n4. Define the prompt and run the chatbot:\n```\ntemplate = \"\"\"You are a helpful AI assistant that makes stories by completing the query provided by the user: {query}\"\"\"\nprompt = PromptTemplate(template=template, input_variables=['query'])\nconv_chain = LLMChain(llm=conv_model, prompt=prompt, verbose=True)\n\nresponse = conv_chain.run(\"Once upon a time in 1947\")\nprint(response)\n```\n## Features\n- Conversational Memory: The chatbot can remember previous interactions, providing a more engaging user experience.\n- Customizable Models: Easily switch between different models from Hugging Face.\n- User-Friendly Interface: Built with Chainlit for an intuitive chat interface.\n\n## Contributing\nContributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.\n\n## License\nThis project is licensed under the MIT License. See the LICENSE file for more details.\n\n## Acknowledgments\n- Hugging Face for providing powerful models.\n- LangChain for simplifying the interaction with language models.\n- Chainlit for the chat interface.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyvandana%2Fchatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyvandana%2Fchatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyvandana%2Fchatbot/lists"}