Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,13 @@ from docx import Document
|
|
| 6 |
import pandas as pd
|
| 7 |
import os
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# Set up Streamlit app
|
| 10 |
st.title("Financial Statement Generator")
|
| 11 |
st.write("Upload a PDF or DOCX file to generate financial statements.")
|
|
@@ -121,12 +128,13 @@ st.sidebar.write("""
|
|
| 121 |
- PyPDF2
|
| 122 |
- python-docx
|
| 123 |
- pandas
|
|
|
|
| 124 |
""")
|
| 125 |
|
| 126 |
# Deployment instructions
|
| 127 |
st.sidebar.subheader("Deployment Instructions")
|
| 128 |
st.sidebar.write("""
|
| 129 |
-
1. Install dependencies: `pip install
|
| 130 |
2. Run the app: `streamlit run app.py`
|
| 131 |
3. Access the app in your browser at `http://localhost:8501`
|
| 132 |
""")
|
|
|
|
| 6 |
import pandas as pd
|
| 7 |
import os
|
| 8 |
|
| 9 |
+
# Check if faiss is installed
|
| 10 |
+
try:
|
| 11 |
+
import faiss
|
| 12 |
+
except ImportError:
|
| 13 |
+
st.error("The `faiss` library is required but not installed. Please install it using `pip install faiss-cpu` (or `faiss-gpu` for GPU support).")
|
| 14 |
+
st.stop()
|
| 15 |
+
|
| 16 |
# Set up Streamlit app
|
| 17 |
st.title("Financial Statement Generator")
|
| 18 |
st.write("Upload a PDF or DOCX file to generate financial statements.")
|
|
|
|
| 128 |
- PyPDF2
|
| 129 |
- python-docx
|
| 130 |
- pandas
|
| 131 |
+
- faiss-cpu (or faiss-gpu)
|
| 132 |
""")
|
| 133 |
|
| 134 |
# Deployment instructions
|
| 135 |
st.sidebar.subheader("Deployment Instructions")
|
| 136 |
st.sidebar.write("""
|
| 137 |
+
1. Install dependencies: `pip install -r requirements.txt`
|
| 138 |
2. Run the app: `streamlit run app.py`
|
| 139 |
3. Access the app in your browser at `http://localhost:8501`
|
| 140 |
""")
|