Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exam Question Answering Chatbot (RAG + Fine-Tuned TinyLlama)

Overview

This project is an AI-powered educational chatbot designed to answer exam-style questions using:

  • RAG (Retrieval-Augmented Generation) for retrieving relevant answers from custom academic datasets
  • FAISS Vector Search for semantic similarity retrieval
  • TinyLlama Fine-Tuning with LoRA + QLoRA for domain-specific answer generation

It is trained on educational JSON datasets containing 4th sem syllabus of my university:

  • DBMS
  • Operating Systems
  • Software Engineering
  • Drug Abuse
  • Algorithm Design

Features

  • Loads JSON-based exam Q&A datasets
  • Converts questions/answers into searchable semantic embeddings
  • Stores and loads FAISS vector index
  • Retrieves top relevant documents based on query similarity
  • Uses TinyLlama + LoRA fine-tuned model for answer generation

## Project Structure

chatbot-v1/
│
├── data/                         # JSON datasets
│   ├── aad.json
│   ├── dbms.json
│   ├── os.json
│   ├── da.json
│   └── se.json
│
├── faiss_index/                  # Generated FAISS vector database
│   ├── index.faiss
│   └── docs.json
│
├── saved_model/                  # Fine-tuned model files
│   └── tiny_llama/
│       └── final_adapter/        # LoRA adapter
│
├── rag.py                        # RAG chatbot pipeline
├── fine_tune.py                  # Fine-tuning pipeline
├── requirements.txt              # Python dependencies
└── README.md                     # Project documentation

How to Run

  1. Run FineTune.py once: python fine_tuned.py

This will fine-tune the model and automatically save it inside the saved_model folder.

  1. After that, run rag.py: python rag.py

This will load the saved fine-tuned model, create/load the FAISS index, and start the chatbot.

  1. Ask your questions and get answers.

Type "exit" anytime to stop.

Deployment

This project is currently deployed on hugging face spaces. The working link is given below. https://huggingface.co/spaces/rayan-sharma-hf/PEA

About

AI-powered Retrieval Augmented Generation (RAG) chatbot built on fine-tuned TinyLlama, designed to answer academic exam questions from custom datasets

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages