Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.1.0
metadata
title: CSRC Car Manual RAG System
emoji: π
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 6.0.0
app_file: app.py
pinned: false
license: mit
CSRC Car Manual RAG System
An intelligent RAG (Retrieval-Augmented Generation) system for querying car manual documents using OpenAI and vector stores.
π Features
- RAG-based Q&A: Ask questions about car manual content
- Vector Store: Fast and accurate document retrieval
- Knowledge Graph: Visualize document relationships
- Personalized Learning: Adaptive learning paths (optional)
- Scenario Contextualization: Context-aware responses (optional)
π Setup Instructions
1. Clone or Upload to Hugging Face Spaces
- Option A: Create a new Space on Hugging Face and upload files
- Option B: Connect your GitHub repository to Spaces
2. Set Environment Variables (Secrets)
Go to Settings > Secrets in your Space and add:
OPENAI_API_KEY=your-openai-api-key-here
β οΈ Important: Never commit API keys to the repository. Always use Spaces Secrets.
3. Upload PDF Files
Ensure your PDF files are in the car_manual/ directory:
car_manual/
βββ Function of Active Distance Assist DISTRONIC.pdf
βββ Function of Active Lane Change Assist.pdf
βββ Function of Active Steering Assist.pdf
βββ Function of Active Stop-and-Go Assist.pdf
4. Wait for Build
Spaces will automatically:
- Install dependencies from
requirements.txt - Run
app.py - Start the Gradio interface
π Project Structure
.
βββ app.py # Hugging Face Spaces entry point
βββ main.py # Local development entry point
βββ requirements.txt # Python dependencies
βββ src/ # Core modules
βββ modules/ # Feature modules
βββ car_manual/ # PDF files directory
βββ config/ # Configuration files
βββ output/ # Output directory (auto-created)
π§ Configuration
Required
- OPENAI_API_KEY: Your OpenAI API key (set in Spaces Secrets)
Optional
- PDF Files: Place in
car_manual/directory - Vector Store: Automatically created on first run
π Usage
- Wait for the Space to build (check the logs)
- Open the Gradio interface
- Enter your question in the input field
- Get answers with source citations
π Troubleshooting
Error: OPENAI_API_KEY not found
- Go to Settings > Secrets
- Add
OPENAI_API_KEYwith your actual API key - Restart the Space
Error: No PDF files found
- Ensure PDF files are in the
car_manual/directory - Check file permissions
- Verify file names (case-sensitive)
Build Fails
- Check the logs for error messages
- Verify
requirements.txtis correct - Ensure all Python dependencies are compatible
π Notes
- Vector store is created automatically on first run
- Vector store ID is saved in
config/vector_store_config.json - First initialization may take time (uploading PDFs to OpenAI)
π Links
π License
MIT License