File size: 2,463 Bytes
b13cac0
 
 
 
3d2d4fc
b13cac0
 
 
 
 
 
3d2d4fc
b13cac0
3d2d4fc
5f08083
3d2d4fc
 
b13cac0
3d2d4fc
 
 
 
b13cac0
3d2d4fc
b13cac0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
title: πŸ“Š Multimodal Financial Forecast
emoji: πŸ“ˆ
colorFrom: indigo
colorTo: green
sdk: docker
pinned: false
---

# πŸ“Š Multimodal Financial Forecast

This app predicts future financial values from time series using an LSTM model. Input sequences or upload CSVs to get started.

## πŸ”§ Tech Stack
- **Backend**: FastAPI (`app/main.py`)
- **ML Model**: PyTorch LSTM
- **Deployment**: Hugging Face Spaces (Docker)

## πŸš€ How to Use
1. Input a JSON-like sequence.
2. Or upload a `.csv` file with numerical sequences.
3. Click β€œPredict” to see the model forecast.


## 🧠 How It Works

1. **User Input**: 
   - You can enter sequences directly or upload a `.csv` with your own data.

2. **Model Inference**:
   - The LSTM model is loaded from `pipeline/trained_models/`.
   - Input sequences are normalized and passed into the model.
   - The output is a forecast of future values.

3. **Output**:
   - The results are displayed directly on the webpage.
   - Graph removed (clean, console-style output).

---

## πŸ›  Tech Stack

| Layer       | Tech        |
|-------------|-------------|
| Backend     | FastAPI     |
| ML Model    | PyTorch LSTM|
| Frontend    | HTML + CSS  |
| Deployment  | Docker + Hugging Face Spaces |

---

## πŸ“‚ Project Structure

multimodal-financial-forecast/
β”œβ”€β”€ app/
β”‚ β”œβ”€β”€ main.py # FastAPI backend
β”‚ β”œβ”€β”€ templates/
β”‚ β”‚ └── index.html # User interface
β”‚ └── static/
β”‚ └── style.css # Stylesheet
β”‚
β”œβ”€β”€ pipeline/
β”‚ β”œβ”€β”€ inference_pipeline.py # Model loading and inference
β”‚ └── trained_models/
β”‚ β”œβ”€β”€ lstm_forecaster.pt # Trained LSTM model
β”‚ └── config.json # Input/output config
β”‚
β”œβ”€β”€ requirements.txt # Python dependencies
β”œβ”€β”€ Dockerfile # Docker config
β”œβ”€β”€ README.md # Project overview
└── .gitignore

## βœ… Requirements

Install dependencies locally (for testing):

```bash
pip install -r requirements.txt

## Run the app locally:

uvicorn app.main:app --reload

## πŸ“ Example CSV Format

Sample input file (for upload):

0.1,0.2,0.3,0.4,0.5
0.5,0.6,0.7,0.8,0.9


## 🐳 Docker Deployment

FROM python:3.10-slim

WORKDIR /app

COPY . .

RUN pip install --upgrade pip && pip install -r requirements.txt

EXPOSE 7860

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]


## Build and Run Locally

docker build -t multimodal-forecast .
docker run -p 7860:7860 multimodal-forecast