Project Report
Project Report
Introduction
This section provides an overview of the project, explaining the need for an AI chatbot and its
applications. It describes how AI chatbots help in answering queries related to AI, Machine
Learning (ML), and Python programming. It also discusses the benefits of an automated AI
assistant for students, developers, and researchers.
To develop an AI chatbot that can answer technical questions related to AI, ML, and
Python.
To ensure that the chatbot provides detailed and informative responses within 30 seconds.
To enable response streaming, so that the chatbot writes answers while generating them.
This section lists the tools and technologies used in the project.
Software Requirements:
Hardware Requirements:
4. Technologies Used
1. Gradio
Gradio is a Python library used to create an interactive web UI for the chatbot. It helps in building a
simple yet powerful chatbot interface.
2. PyTorch
PyTorch is an open-source machine learning framework that allows efficient deep learning model
execution. The chatbot uses PyTorch to load and execute the Phi-2 AI model.
3. Transformers Library
The transformers library (by Hugging Face) is used to load and fine-tune pre-trained models for
text generation. The Phi-2 model used in this project is optimized for conversational AI tasks.
5. Implementation Details
This section describes the code structure and logic behind the chatbot.
When the user inputs a question, the chatbot converts it into tokenized form.
The chatbot generates answers word by word and displays them while processing.
If the answer is too long, the chatbot either completes it automatically or asks the user if
they want to continue.
7. Challenges Faced
o Solution: Used streaming responses and limited max tokens for faster answers.
Large Answer Handling: Some responses were cut off due to token limits.
8. Future Enhancements
9. Conclusion
The system is optimized for fast inference and has a user-friendly UI.