Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available: 6.14.0
metadata
title: My Ai Twin
emoji: 🤖
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 5.16.0
app_file: app.py
pinned: false
license: mit
AI Twin RAG Application
This application is an AI Twin of yourself, built using Retrieval-Augmented Generation (RAG). It answers questions based on your personal data stored in the knowledge_base/ directory.
Features
- Personal Knowledge Base: Uses your real and synthetic data to answer questions.
- RAG Pipeline: Utilizes LangChain, ChromaDB, and Hugging Face embeddings for accurate retrieval.
- Interactive UI: Built with Gradio for easy interaction.
Setup & Installation
Install Dependencies:
pip install -r requirements.txtSet Up Hugging Face Token:
- You need a Hugging Face API token to use the inference endpoint.
- Set it as an environment variable:
export HUGGINGFACEHUB_API_TOKEN="your_token_here" # Windows PowerShell: $env:HUGGINGFACEHUB_API_TOKEN="your_token_here" - Or uncomment the line in
app.pyto set it directly.
Run Verification (Optional):
python verify_rag.pyLaunch the App:
python app.pyThe app will run locally at
http://127.0.0.1:7860.
Deployment to Hugging Face Spaces
- Create a new Space on Hugging Face.
- Select Gradio as the SDK.
- Upload the following files:
app.pyrequirements.txtknowledge_base/(entire folder)chroma_db/(optional, can be generated on the fly, but better to let it generate)
- Add your
HUGGINGFACEHUB_API_TOKENin the Space settings (Settings -> Variables and secrets).
Files
app.py: Main application logic.knowledge_base/: Directory containing your profile data.requirements.txt: Python dependencies.verify_rag.py: Script to test RAG logic without UI.