Welcome to the "Chat with the University" application! This application allows users to interact with an AI model to get information about various university topics. It uses Streamlit
for the web interface, LangChain
for embeddings and conversation management, and HuggingFace models for language generation.
- Interactive Chat: Users can ask questions about various university topics.
- Topic-Based Retrieval: The application supports multiple topics by using pre-built vector stores.
- Advanced AI Model: Leverages HuggingFace models for natural language understanding and generation.
To run this application, you will need:
- Python 3.8 or higher
- Streamlit
- LangChain
- HuggingFace Transformers
- PyTorch
- Additional libraries (see
requirements.txt
)
-
Clone the Repository
git clone https://github.com/your-username/chat-with-the-university.git cd chat-with-the-university
-
Create a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install Dependencies
pip install -r requirements.txt
-
Set Up API Keys
Create a
.streamlit/secrets.toml
file in the project directory and add your HuggingFace API key:[general] HUGGINGFACEHUB_API_KEY = "your_huggingface_api_key_here"
-
Run the Streamlit App
streamlit run app.py
-
Interact with the App
Open your browser and navigate to
http://localhost:8501
. You will see the chat interface where you can ask questions about university topics. -
Select a Topic
Use the sidebar to select a topic related to your query. The application will load the appropriate vector store and process your questions.
main_2.py
: Main Streamlit application file that handles user input and interaction.requirements.txt
: Lists all Python package dependencies.htmlTemplates.py
: Contains HTML templates for styling chat messages.preprocess_embedding.py
: Script used to create and save FAISS vector stores from web content.
-
main_2.py
: Manages the Streamlit app interface and integrates with LangChain for conversational retrieval.- Loads API keys.
- Provides functions to handle user input and manage chat history.
- Sets up vector stores and conversation chains based on selected topics.
-
preprocess_embedding.py
: Handles the creation and storage of FAISS vector stores.- Retrieves and processes web content.
- Splits content into chunks and embeds it.
- Saves vector stores locally for efficient retrieval.
Feel free to open issues or submit pull requests if you have suggestions or improvements. Please follow the project's code of conduct and contribution guidelines.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or feedback, please contact [email protected].