Spaces:
Runtime error
Runtime error
metadata
title: Mozhii RAG Data Platform
emoji: ποΈ
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
ποΈ Mozhii RAG Data Platform v0.1
Creating Universal Tamil AI Ecosystem
A web-based data platform for RAG (Retrieval-Augmented Generation) dataset creation, specifically designed for Tamil language content with enterprise-grade workflow management.
π Project Structure
mozhii-platform/
βββ app/
β βββ __init__.py # Flask app initialization
β βββ config.py # Configuration settings
β βββ routes/
β β βββ __init__.py # Routes initialization
β β βββ raw_data.py # Raw data tab API endpoints
β β βββ cleaning.py # Cleaning tab API endpoints
β β βββ chunking.py # Chunking tab API endpoints
β β βββ admin.py # Admin approval endpoints
β βββ services/
β β βββ __init__.py # Services initialization
β β βββ huggingface.py # HuggingFace API integration
β β βββ storage.py # Local storage management
β βββ models/
β βββ __init__.py # Models initialization
β βββ schemas.py # Data schemas/models
βββ static/
β βββ css/
β β βββ styles.css # Modern UI styles
β βββ js/
β β βββ main.js # Main JavaScript
β β βββ raw-data.js # Raw data tab logic
β β βββ cleaning.js # Cleaning tab logic
β β βββ chunking.js # Chunking tab logic
β βββ assets/
β βββ logo.svg # Platform logo
βββ templates/
β βββ index.html # Main HTML template
βββ data/
β βββ pending/ # Files awaiting approval
β β βββ raw/ # Pending raw files
β β βββ cleaned/ # Pending cleaned files
β β βββ chunked/ # Pending chunks
β βββ approved/ # Approved files (synced with HF)
β βββ raw/
β βββ cleaned/
β βββ chunked/
βββ requirements.txt # Python dependencies
βββ run.py # Application entry point
βββ README.md # This file
π Data Flow Architecture
βββββββββββββββββββ
β RAW DATA TAB β β Collector submits Tamil content
ββββββββββ¬βββββββββ
β
βββββββββββββββββββ
β Admin Review β β Approve/Reject
ββββββββββ¬βββββββββ
β
βββββββββββββββββββ
β HF: mozhii-raw β β HuggingFace Repository #1
ββββββββββ¬βββββββββ
β
βββββββββββββββββββ
β CLEANING TAB β β NLP team cleans content
ββββββββββ¬βββββββββ
β
βββββββββββββββββββ
β Admin Review β β Approve/Reject
ββββββββββ¬βββββββββ
β
βββββββββββββββββββ
β HF: mozhii-cleanβ β HuggingFace Repository #2
ββββββββββ¬βββββββββ
β
βββββββββββββββββββ
β CHUNKING TAB β β QA team creates chunks
ββββββββββ¬βββββββββ
β
βββββββββββββββββββ
β Admin Review β β Approve/Reject
ββββββββββ¬βββββββββ
β
βββββββββββββββββββ
β HF: mozhii-chunkβ β HuggingFace Repository #3 (RAG-READY)
ββββββββββ¬βββββββββ
β
βββββββββββββββββββ
βEmbedding Pipelineβ β External (FAISS/Chroma)
βββββββββββββββββββ
π Quick Start
1. Install Dependencies
cd mozhii-platform
pip install -r requirements.txt
2. Configure HuggingFace
Create a .env file:
HF_TOKEN=your_huggingface_token
HF_RAW_REPO=your-org/mozhii-raw-data
HF_CLEANED_REPO=your-org/mozhii-cleaned-data
HF_CHUNKED_REPO=your-org/mozhii-chunked-data
3. Run the Application
python run.py
4. Open in Browser
Navigate to http://localhost:5000
π Features
- β Evidence at every stage - Complete audit trail
- β Team parallelism - Multiple users can work simultaneously
- β Admin approval workflow - Quality control gate with editing
- β Edit before approval - Fix mistakes without rejecting submissions
- β HuggingFace integration - Direct push to your HF repositories
- β Custom HF repos - Use your own HuggingFace account
- β Role-based access - Collector, Cleaner, Chunker, Admin
- β Tamil language optimized - RTL support, Tamil fonts
βοΈ Admin Panel Features
Edit Functionality
The admin panel now includes powerful editing capabilities:
- βοΈ Edit Button: Click the edit icon next to any pending item to modify its content
- Live Preview: See changes in real-time before saving
- Character Count: Track content length while editing
- Save & Continue: Save edits without approving
- Reject with Reason: Provide feedback when rejecting submissions
HuggingFace Integration
Push approved data directly to your HuggingFace repositories:
- Configure Credentials: Enter your HF token in the admin panel
- Set Repository: Specify your target repository (e.g.,
username/mozhii-data) - One-Click Push: Upload all approved data with a single click
- Detailed Results: See upload status for raw, cleaned, and chunked data
Setup Instructions:
# 1. Get your HuggingFace token
# Visit: https://huggingface.co/settings/tokens
# 2. Create dataset repositories
# Visit: https://huggingface.co/new-dataset
# Create: username/mozhii-raw-data
# Create: username/mozhii-cleaned-data
# Create: username/mozhii-chunked-data
# 3. Enter credentials in Admin Panel or .env file
HF_TOKEN=hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
HF_RAW_REPO=your-username/mozhii-raw-data
Workflow
βββββββββββββββββββββββ
β User Submits Data β
ββββββββββββ¬βββββββββββ
β
βββββββββββββββββββββββ
β Admin Reviews β
ββββββββββββ¬βββββββββββ
β
ββββββββ΄βββββββ
β β
βββββββββββ βββββββββββ
β Edit β β Approve β
ββββββ¬βββββ ββββββ¬βββββ
β β
βββββββββββ βββββββββββ
β Save β βPush to β
ββββββ¬βββββ β HF β
β βββββββββββ
βββββββββββ
β Approve β
βββββββββββ
π₯ Roles
| Role | Access |
|---|---|
| Collector | RAW DATA tab only |
| Cleaner | CLEANING tab only |
| Chunker | CHUNKING tab only |
| Admin | All tabs + Approval queue |
π License
MIT License - Mozhii AI Team 2026