amitgpt's picture
Update README.md
7a90b4b verified
---
title: SAP Finance Dashboard with RPT-1-OSS
emoji: πŸ“Š
colorFrom: purple
colorTo: blue
sdk: docker
app_port: 7860
app_file: app_gradio.py
pinned: false
license: apache-2.0
---
# πŸ“Š SAP Finance Dashboard with RPT-1-OSS Model
> **Production-ready AI-powered financial analysis dashboard** with SAP data integration, ML predictions, and interactive visualizations.
**πŸ”— Live Demo**: https://huggingface.co/spaces/amitgpt/sap-finance-dashboard-RPT-1-OSS
---
## πŸ“‹ Table of Contents
- [Overview](#overview)
- [Architecture](#architecture)
- [Key Features](#key-features)
- [What You'll Achieve](#what-youll-achieve)
- [Prerequisites](#prerequisites)
- [Quick Start](#quick-start)
- [Local Development](#local-development)
- [Deployment](#deployment)
- [Project Structure](#project-structure)
- [Troubleshooting](#troubleshooting)
- [License](#license)
---
## 🎯 Overview
The **SAP Finance Dashboard** is an enterprise-grade web application that brings AI-powered financial intelligence to SAP systems. It combines:
- **Real-time SAP data** through OData connectors
- **Advanced ML predictions** using the SAP-RPT-1-OSS model (Retrieval-Pretrained Transformer)
- **Interactive analytics** with Plotly visualizations
- **No-code ML training** via the Playground tab
- **Multi-user support** with secure authentication
**Perfect for**:
- SAP finance teams needing predictive insights
- Data analysts building custom financial models
- Organizations requiring automated SAP reporting
- Learning AI/ML in enterprise contexts
---
## πŸ—οΈ Architecture
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Gradio Web Interface β”‚
β”‚ (Dashboard β€’ Data Explorer β€’ Predictions β€’ Playground) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚ β”‚ β”‚
β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SAP β”‚ β”‚ SAP-RPT-1- β”‚ β”‚ Plotly β”‚ β”‚ Hugging β”‚
β”‚ OData β”‚ β”‚ OSS Model β”‚ β”‚ Visualizer β”‚ β”‚ Face Hub β”‚
β”‚Connectorβ”‚ β”‚ (Classifier/ β”‚ β”‚ (Charts) β”‚ β”‚ (Models) β”‚
β”‚ β”‚ β”‚ Regressor) β”‚ β”‚ β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚
β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Python + Pandas + NumPy + PyTorch β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
---
## ✨ Key Features
### 1. **Dashboard Tab** πŸ“ˆ
- Key financial metrics (Revenue, Expenses, Net Income)
- Revenue vs. Expense breakdown
- Balance sheet analysis
- Real-time metric cards with trend indicators
- Fully interactive Plotly charts
### 2. **Data Explorer Tab** πŸ”
- Browse synthetic SAP datasets:
- **GL Accounts**: Chart of Accounts with balances
- **Financial Statements**: Multi-period P&L and Balance Sheet
- **Sales Orders**: Order details with line items
- Filter, search, and export capabilities
- Data validation and profiling
### 3. **Upload Tab** πŸ“€
- Upload custom CSV datasets
- Automatic data validation
- Preview before processing
- Support for various SAP data formats
### 4. **Predictions Tab** πŸ€–
- AI-powered financial forecasting using SAP-RPT-1-OSS
- Classification tasks (e.g., account categorization)
- Regression tasks (e.g., amount prediction)
- Confidence scores and explainability
- Batch prediction support
### 5. **Playground Tab** πŸ› οΈ
- **No-code ML training** interface
- Upload training datasets
- Configure model parameters:
- Context size (2048 for CPU, 8192 for GPU)
- Bagging factor (1-8)
- Model type (Classifier or Regressor)
- Train custom models
- Download predictions and model outputs
- Performance metrics display
### 6. **OData Connector Tab** πŸ”Œ
- Direct connection to SAP systems
- Real-time data retrieval
- Secure credential handling
- Support for OData v2 and v4
- Query builder interface
---
## πŸŽ“ What You'll Achieve
After forking and deploying this repository, you'll have:
### βœ… **Enterprise Web Application**
- Production-ready Gradio interface
- Docker containerization for any cloud platform
- Multi-user authentication support
- Responsive design for desktop/mobile
### βœ… **AI Integration**
- Hands-on experience with the SAP-RPT-1-OSS model
- Understanding of Transformer-based financial predictions
- Custom model training workflows
- Real-time inference optimization
### βœ… **SAP Integration**
- OData connector patterns for SAP systems
- Secure credential management
- Real-time data pipeline examples
- Chart of Accounts and transaction handling
### βœ… **Cloud Deployment Skills**
- Docker multi-stage builds for ML apps
- HuggingFace Spaces deployment
- Azure Container Apps integration (optional)
- Environment management and secrets handling
### βœ… **Data Science Pipeline**
- Data preprocessing and validation
- Feature engineering examples
- Model training and evaluation
- Prediction batch processing
---
## πŸ“¦ Prerequisites
### Local Development
- **Python 3.11+** (tested on 3.11)
- **Git** (for version control)
- **pip** (Python package manager)
- **Virtual environment** (recommended: venv or conda)
### For Cloud Deployment
- **Docker** (for containerization)
- **Hugging Face account** (free, for SAP-RPT-1-OSS access)
- **HF authentication token** (for gated models)
### For SAP Integration
- **SAP OData endpoint** URL
- **SAP credentials** (username/password or OAuth token)
- **Network access** to SAP system
### For GPU Support (Optional)
- **NVIDIA GPU** (CUDA 11.8+)
- **8GB+ VRAM** (recommended for model training)
---
## πŸš€ Quick Start
### Option 1: Run on HuggingFace Spaces (Easiest, 5 minutes)
1. **Fork this repo to HF Spaces**
```bash
# Visit: https://huggingface.co/spaces/amitgpt/sap-finance-dashboard-RPT-1-OSS
# Click "Files" β†’ "Clone repository"
Accept SAP-RPT-1-OSS Model Access
Go to: https://huggingface.co/SAP/sap-rpt-1-oss
Click "Agree" button
Create HF Token
https://huggingface.co/settings/tokens
Click "New token" β†’ Name it β†’ Select "Read" β†’ Create
Add Token to Your Space
Go to your Space settings β†’ "Repository secrets"
Add: HF_TOKEN = [your token from step 3]
Wait 2-3 minutes for rebuild
Done! Your Space will rebuild and start automatically
πŸ‘‰ See QUICK_START.md for detailed screenshots and troubleshooting
Option 2: Local Development (Recommended for customization)
Step 1: Clone Repository
git clone https://github.com/yourusername/SAP-RPT-1-OSS-App.git
cd SAP-RPT-1-OSS-App
Step 2: Create Virtual Environment
# On Windows
python -m venv venv
venv\Scripts\activate
# On macOS/Linux
python3 -m venv venv
source venv/bin/activate
Step 3: Install Dependencies
pip install --upgrade pip
pip install -r requirements.txt
pip install gradio==4.44.1
pip install huggingface-hub==0.24.7
pip install torch==2.0.0 transformers==4.30.0
pip install git+https://github.com/SAP-samples/sap-rpt-1-oss
Step 4: Create Environment File
cp .env.example .env
# Edit .env and add:
# - HUGGINGFACE_TOKEN=hf_xxxxx
# - SAP_USERNAME=your_sap_user (optional)
# - SAP_PASSWORD=your_sap_pwd (optional)
# - SAP_SERVER=sap_system_url (optional)
Step 5: Run Application
python app_gradio.py
The app will start at: http://localhost:7860
🐳 Docker Deployment
Build Docker Image
docker build -t sap-finance-dashboard:latest .
πŸ“Š Usage Examples
Example 1: View Financial Dashboard
Open: http://localhost:7860
Click Dashboard tab
See metrics and charts instantly
Example 2: Make AI Predictions
Go to Predictions tab
Upload a CSV with financial data
Configure model settings
Click "Predict"
Download results
Example 3: Train Custom Model
Go to Playground tab
Upload training dataset
Set model parameters
Click "Train Model"
Download predictions and metrics
Example 4: Connect to SAP System
Go to OData tab
Enter SAP credentials and OData endpoint
Build query
Execute and view results
🀝 Contributing
We welcome contributions! Please:
Fork the repository
Create a feature branch (git checkout -b feature/amazing-feature)
Commit changes (git commit -m 'Add amazing feature')
Push to branch (git push origin feature/amazing-feature)
Open Pull Request
πŸ“„ License
This project is licensed under the Apache 2.0 License - see LICENSE file for details.
Attribution: Uses the SAP-RPT-1-OSS model (also Apache 2.0).
πŸ™‹ Support
Questions? Open an issue on GitHub
Deployment help? See QUICK_START.md
Authentication issues? See HF_AUTHENTICATION_SETUP.md
Status updates? See DEPLOYMENT_STATUS.md
πŸ“ˆ Roadmap
Real-time SAP system synchronization
Multi-language support
Advanced explainability (SHAP, LIME)
Time-series forecasting models
Automated report generation (PDF/Excel)
Mobile app version
Integration with SAP Analytics Cloud
Made with ❀️ for SAP developers and data scientists to test SAP Opensource RPT-1
Developed by Amit Lal, Microsoft
aka.ms/amitlal
Last Updated: December 6, 2025