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| 11 |
---
|
| 12 |
|
| 13 |
+
# π SAP Finance Dashboard with RPT-1-OSS Model
|
| 14 |
|
| 15 |
+
> **Production-ready AI-powered financial analysis dashboard** with SAP data integration, ML predictions, and interactive visualizations.
|
| 16 |
|
| 17 |
+
**π Live Demo**: https://huggingface.co/spaces/amitgpt/sap-finance-dashboard-RPT-1-OSS
|
| 18 |
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
## π Table of Contents
|
| 22 |
+
|
| 23 |
+
- [Overview](#overview)
|
| 24 |
+
- [Architecture](#architecture)
|
| 25 |
+
- [Key Features](#key-features)
|
| 26 |
+
- [What You'll Achieve](#what-youll-achieve)
|
| 27 |
+
- [Prerequisites](#prerequisites)
|
| 28 |
+
- [Quick Start](#quick-start)
|
| 29 |
+
- [Local Development](#local-development)
|
| 30 |
+
- [Deployment](#deployment)
|
| 31 |
+
- [Project Structure](#project-structure)
|
| 32 |
+
- [Troubleshooting](#troubleshooting)
|
| 33 |
+
- [License](#license)
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
## π― Overview
|
| 38 |
+
|
| 39 |
+
The **SAP Finance Dashboard** is an enterprise-grade web application that brings AI-powered financial intelligence to SAP systems. It combines:
|
| 40 |
+
|
| 41 |
+
- **Real-time SAP data** through OData connectors
|
| 42 |
+
- **Advanced ML predictions** using the SAP-RPT-1-OSS model (Retrieval-Pretrained Transformer)
|
| 43 |
+
- **Interactive analytics** with Plotly visualizations
|
| 44 |
+
- **No-code ML training** via the Playground tab
|
| 45 |
+
- **Multi-user support** with secure authentication
|
| 46 |
+
|
| 47 |
+
**Perfect for**:
|
| 48 |
+
- SAP finance teams needing predictive insights
|
| 49 |
+
- Data analysts building custom financial models
|
| 50 |
+
- Organizations requiring automated SAP reporting
|
| 51 |
+
- Learning AI/ML in enterprise contexts
|
| 52 |
+
|
| 53 |
+
---
|
| 54 |
+
|
| 55 |
+
## ποΈ Architecture
|
| 56 |
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 57 |
+
β Gradio Web Interface β
|
| 58 |
+
β (Dashboard β’ Data Explorer β’ Predictions β’ Playground) β
|
| 59 |
+
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
|
| 60 |
+
β
|
| 61 |
+
ββββββββββ΄βββββββββ¬βββββββββββββ¬ββββββββββββββββββ
|
| 62 |
+
β β β β
|
| 63 |
+
ββββββΌβββββ ββββββββΌβββββββ βββΌβββββββββββββ ββββΌβββββββββββ
|
| 64 |
+
β SAP β β SAP-RPT-1- β β Plotly β β Hugging β
|
| 65 |
+
β OData β β OSS Model β β Visualizer β β Face Hub β
|
| 66 |
+
βConnectorβ β (Classifier/ β β (Charts) β β (Models) β
|
| 67 |
+
β β β Regressor) β β β β β
|
| 68 |
+
βββββββββββ ββββββββββββββββ βββββββββββββββ βββββββββββββββ
|
| 69 |
+
β β
|
| 70 |
+
ββββββΌββββββββββββββββββΌββββββββββββββββββ
|
| 71 |
+
β Python + Pandas + NumPy + PyTorch β
|
| 72 |
+
ββββββββββββββββββββββββββββββββββββββββββ
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
---
|
| 76 |
+
|
| 77 |
+
## β¨ Key Features
|
| 78 |
+
|
| 79 |
+
### 1. **Dashboard Tab** π
|
| 80 |
+
- Key financial metrics (Revenue, Expenses, Net Income)
|
| 81 |
+
- Revenue vs. Expense breakdown
|
| 82 |
+
- Balance sheet analysis
|
| 83 |
+
- Real-time metric cards with trend indicators
|
| 84 |
+
- Fully interactive Plotly charts
|
| 85 |
+
|
| 86 |
+
### 2. **Data Explorer Tab** π
|
| 87 |
+
- Browse synthetic SAP datasets:
|
| 88 |
+
- **GL Accounts**: Chart of Accounts with balances
|
| 89 |
+
- **Financial Statements**: Multi-period P&L and Balance Sheet
|
| 90 |
+
- **Sales Orders**: Order details with line items
|
| 91 |
+
- Filter, search, and export capabilities
|
| 92 |
+
- Data validation and profiling
|
| 93 |
+
|
| 94 |
+
### 3. **Upload Tab** π€
|
| 95 |
+
- Upload custom CSV datasets
|
| 96 |
+
- Automatic data validation
|
| 97 |
+
- Preview before processing
|
| 98 |
+
- Support for various SAP data formats
|
| 99 |
+
|
| 100 |
+
### 4. **Predictions Tab** π€
|
| 101 |
+
- AI-powered financial forecasting using SAP-RPT-1-OSS
|
| 102 |
+
- Classification tasks (e.g., account categorization)
|
| 103 |
+
- Regression tasks (e.g., amount prediction)
|
| 104 |
+
- Confidence scores and explainability
|
| 105 |
+
- Batch prediction support
|
| 106 |
+
|
| 107 |
+
### 5. **Playground Tab** π οΈ
|
| 108 |
+
- **No-code ML training** interface
|
| 109 |
+
- Upload training datasets
|
| 110 |
+
- Configure model parameters:
|
| 111 |
+
- Context size (2048 for CPU, 8192 for GPU)
|
| 112 |
+
- Bagging factor (1-8)
|
| 113 |
+
- Model type (Classifier or Regressor)
|
| 114 |
+
- Train custom models
|
| 115 |
+
- Download predictions and model outputs
|
| 116 |
+
- Performance metrics display
|
| 117 |
+
|
| 118 |
+
### 6. **OData Connector Tab** π
|
| 119 |
+
- Direct connection to SAP systems
|
| 120 |
+
- Real-time data retrieval
|
| 121 |
+
- Secure credential handling
|
| 122 |
+
- Support for OData v2 and v4
|
| 123 |
+
- Query builder interface
|
| 124 |
+
|
| 125 |
+
---
|
| 126 |
+
|
| 127 |
+
## π What You'll Achieve
|
| 128 |
+
|
| 129 |
+
After forking and deploying this repository, you'll have:
|
| 130 |
+
|
| 131 |
+
### β
**Enterprise Web Application**
|
| 132 |
+
- Production-ready Gradio interface
|
| 133 |
+
- Docker containerization for any cloud platform
|
| 134 |
+
- Multi-user authentication support
|
| 135 |
+
- Responsive design for desktop/mobile
|
| 136 |
+
|
| 137 |
+
### β
**AI Integration**
|
| 138 |
+
- Hands-on experience with the SAP-RPT-1-OSS model
|
| 139 |
+
- Understanding of Transformer-based financial predictions
|
| 140 |
+
- Custom model training workflows
|
| 141 |
+
- Real-time inference optimization
|
| 142 |
+
|
| 143 |
+
### β
**SAP Integration**
|
| 144 |
+
- OData connector patterns for SAP systems
|
| 145 |
+
- Secure credential management
|
| 146 |
+
- Real-time data pipeline examples
|
| 147 |
+
- Chart of Accounts and transaction handling
|
| 148 |
+
|
| 149 |
+
### β
**Cloud Deployment Skills**
|
| 150 |
+
- Docker multi-stage builds for ML apps
|
| 151 |
+
- HuggingFace Spaces deployment
|
| 152 |
+
- Azure Container Apps integration (optional)
|
| 153 |
+
- Environment management and secrets handling
|
| 154 |
+
|
| 155 |
+
### β
**Data Science Pipeline**
|
| 156 |
+
- Data preprocessing and validation
|
| 157 |
+
- Feature engineering examples
|
| 158 |
+
- Model training and evaluation
|
| 159 |
+
- Prediction batch processing
|
| 160 |
+
|
| 161 |
+
---
|
| 162 |
+
|
| 163 |
+
## π¦ Prerequisites
|
| 164 |
+
|
| 165 |
+
### Local Development
|
| 166 |
+
- **Python 3.11+** (tested on 3.11)
|
| 167 |
+
- **Git** (for version control)
|
| 168 |
+
- **pip** (Python package manager)
|
| 169 |
+
- **Virtual environment** (recommended: venv or conda)
|
| 170 |
+
|
| 171 |
+
### For Cloud Deployment
|
| 172 |
+
- **Docker** (for containerization)
|
| 173 |
+
- **Hugging Face account** (free, for SAP-RPT-1-OSS access)
|
| 174 |
+
- **HF authentication token** (for gated models)
|
| 175 |
+
|
| 176 |
+
### For SAP Integration
|
| 177 |
+
- **SAP OData endpoint** URL
|
| 178 |
+
- **SAP credentials** (username/password or OAuth token)
|
| 179 |
+
- **Network access** to SAP system
|
| 180 |
+
|
| 181 |
+
### For GPU Support (Optional)
|
| 182 |
+
- **NVIDIA GPU** (CUDA 11.8+)
|
| 183 |
+
- **8GB+ VRAM** (recommended for model training)
|
| 184 |
+
|
| 185 |
+
---
|
| 186 |
+
|
| 187 |
+
## π Quick Start
|
| 188 |
+
|
| 189 |
+
### Option 1: Run on HuggingFace Spaces (Easiest, 5 minutes)
|
| 190 |
+
|
| 191 |
+
1. **Fork this repo to HF Spaces**
|
| 192 |
+
```bash
|
| 193 |
+
# Visit: https://huggingface.co/spaces/amitgpt/sap-finance-dashboard-RPT-1-OSS
|
| 194 |
+
# Click "Files" β "Clone repository"
|
| 195 |
+
Accept SAP-RPT-1-OSS Model Access
|
| 196 |
+
|
| 197 |
+
Go to: https://huggingface.co/SAP/sap-rpt-1-oss
|
| 198 |
+
Click "Agree" button
|
| 199 |
+
Create HF Token
|
| 200 |
+
|
| 201 |
+
https://huggingface.co/settings/tokens
|
| 202 |
+
Click "New token" β Name it β Select "Read" β Create
|
| 203 |
+
Add Token to Your Space
|
| 204 |
+
|
| 205 |
+
Go to your Space settings β "Repository secrets"
|
| 206 |
+
Add: HF_TOKEN = [your token from step 3]
|
| 207 |
+
Wait 2-3 minutes for rebuild
|
| 208 |
+
Done! Your Space will rebuild and start automatically
|
| 209 |
+
|
| 210 |
+
π See QUICK_START.md for detailed screenshots and troubleshooting
|
| 211 |
+
Option 2: Local Development (Recommended for customization)
|
| 212 |
+
Step 1: Clone Repository
|
| 213 |
+
git clone https://github.com/yourusername/SAP-RPT-1-OSS-App.git
|
| 214 |
+
cd SAP-RPT-1-OSS-App
|
| 215 |
+
|
| 216 |
+
Step 2: Create Virtual Environment
|
| 217 |
+
|
| 218 |
+
# On Windows
|
| 219 |
+
python -m venv venv
|
| 220 |
+
venv\Scripts\activate
|
| 221 |
+
|
| 222 |
+
# On macOS/Linux
|
| 223 |
+
python3 -m venv venv
|
| 224 |
+
source venv/bin/activate
|
| 225 |
+
|
| 226 |
+
Step 3: Install Dependencies
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
pip install --upgrade pip
|
| 230 |
+
pip install -r requirements.txt
|
| 231 |
+
pip install gradio==4.44.1
|
| 232 |
+
pip install huggingface-hub==0.24.7
|
| 233 |
+
pip install torch==2.0.0 transformers==4.30.0
|
| 234 |
+
pip install git+https://github.com/SAP-samples/sap-rpt-1-oss
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
Step 4: Create Environment File
|
| 238 |
+
|
| 239 |
+
cp .env.example .env
|
| 240 |
+
# Edit .env and add:
|
| 241 |
+
# - HUGGINGFACE_TOKEN=hf_xxxxx
|
| 242 |
+
# - SAP_USERNAME=your_sap_user (optional)
|
| 243 |
+
# - SAP_PASSWORD=your_sap_pwd (optional)
|
| 244 |
+
# - SAP_SERVER=sap_system_url (optional)
|
| 245 |
+
|
| 246 |
+
|
| 247 |
+
Step 5: Run Application
|
| 248 |
+
python app_gradio.py
|
| 249 |
+
The app will start at: http://localhost:7860
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
π³ Docker Deployment
|
| 253 |
+
Build Docker Image
|
| 254 |
+
docker build -t sap-finance-dashboard:latest .
|
| 255 |
+
|
| 256 |
+
π Usage Examples
|
| 257 |
+
Example 1: View Financial Dashboard
|
| 258 |
+
Open: http://localhost:7860
|
| 259 |
+
Click Dashboard tab
|
| 260 |
+
See metrics and charts instantly
|
| 261 |
+
Example 2: Make AI Predictions
|
| 262 |
+
Go to Predictions tab
|
| 263 |
+
Upload a CSV with financial data
|
| 264 |
+
Configure model settings
|
| 265 |
+
Click "Predict"
|
| 266 |
+
Download results
|
| 267 |
+
Example 3: Train Custom Model
|
| 268 |
+
Go to Playground tab
|
| 269 |
+
Upload training dataset
|
| 270 |
+
Set model parameters
|
| 271 |
+
Click "Train Model"
|
| 272 |
+
Download predictions and metrics
|
| 273 |
+
Example 4: Connect to SAP System
|
| 274 |
+
Go to OData tab
|
| 275 |
+
Enter SAP credentials and OData endpoint
|
| 276 |
+
Build query
|
| 277 |
+
Execute and view results
|
| 278 |
+
|
| 279 |
+
π€ Contributing
|
| 280 |
+
We welcome contributions! Please:
|
| 281 |
+
|
| 282 |
+
Fork the repository
|
| 283 |
+
Create a feature branch (git checkout -b feature/amazing-feature)
|
| 284 |
+
Commit changes (git commit -m 'Add amazing feature')
|
| 285 |
+
Push to branch (git push origin feature/amazing-feature)
|
| 286 |
+
Open Pull Request
|
| 287 |
+
|
| 288 |
+
|
| 289 |
+
π License
|
| 290 |
+
This project is licensed under the Apache 2.0 License - see LICENSE file for details.
|
| 291 |
+
|
| 292 |
+
Attribution: Uses the SAP-RPT-1-OSS model (also Apache 2.0).
|
| 293 |
|
| 294 |
+
π Support
|
| 295 |
+
Questions? Open an issue on GitHub
|
| 296 |
+
Deployment help? See QUICK_START.md
|
| 297 |
+
Authentication issues? See HF_AUTHENTICATION_SETUP.md
|
| 298 |
+
Status updates? See DEPLOYMENT_STATUS.md
|
| 299 |
|
| 300 |
+
π Roadmap
|
| 301 |
+
Real-time SAP system synchronization
|
| 302 |
+
Multi-language support
|
| 303 |
+
Advanced explainability (SHAP, LIME)
|
| 304 |
+
Time-series forecasting models
|
| 305 |
+
Automated report generation (PDF/Excel)
|
| 306 |
+
Mobile app version
|
| 307 |
+
Integration with SAP Analytics Cloud
|
| 308 |
|
|
|
|
| 309 |
|
| 310 |
+
Made with β€οΈ for SAP developers and data scientists to test SAP Opensource RPT-1
|
| 311 |
|
| 312 |
+
Developed by Amit Lal, Microsoft
|
| 313 |
+
aka.ms/amitlal
|
| 314 |
+
|
| 315 |
|
| 316 |
+
Last Updated: December 6, 2025
|