bluestpanda commited on
Commit
97b410a
·
1 Parent(s): 14eb8bf

Increase file upload limit to 1 GB

Browse files

- Added .streamlit/config.toml with maxUploadSize=1024MB
- Updated streamlit_app.py with st.set_option for upload size
- Modified Dockerfile to include config and set upload size
- Updated file uploader UI to show 1 GB limit

Files changed (3) hide show
  1. .streamlit/config.toml +2 -0
  2. Dockerfile +2 -1
  3. src/streamlit_app.py +5 -2
.streamlit/config.toml ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [server]
2
+ maxUploadSize = 1024 # 1 GB in MB
Dockerfile CHANGED
@@ -11,6 +11,7 @@ RUN apt-get update && apt-get install -y \
11
  COPY requirements.txt ./
12
  COPY src/ ./src/
13
  COPY structure_analysis.py ./src/
 
14
 
15
  RUN pip3 install -r requirements.txt
16
 
@@ -18,4 +19,4 @@ EXPOSE 8501
18
 
19
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
20
 
21
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
11
  COPY requirements.txt ./
12
  COPY src/ ./src/
13
  COPY structure_analysis.py ./src/
14
+ COPY .streamlit/ ./.streamlit/
15
 
16
  RUN pip3 install -r requirements.txt
17
 
 
19
 
20
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
21
 
22
+ ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.maxUploadSize=1024"]
src/streamlit_app.py CHANGED
@@ -17,6 +17,9 @@ st.set_page_config(
17
  layout="wide"
18
  )
19
 
 
 
 
20
  # Import our modules
21
  try:
22
  from structure_analysis import (
@@ -173,9 +176,9 @@ def main():
173
 
174
  # File upload
175
  uploaded_file = st.file_uploader(
176
- "Choose a JSON file",
177
  type=['json'],
178
- help="Upload a JSON file with structured data"
179
  )
180
 
181
  if uploaded_file is not None:
 
17
  layout="wide"
18
  )
19
 
20
+ # Configure upload size limit (1 GB)
21
+ st.set_option("server.maxUploadSize", 1024) # 1024 MB = 1 GB
22
+
23
  # Import our modules
24
  try:
25
  from structure_analysis import (
 
176
 
177
  # File upload
178
  uploaded_file = st.file_uploader(
179
+ "Choose a JSON file (Max size: 1 GB)",
180
  type=['json'],
181
+ help="Upload a JSON file with structured data (Maximum file size: 1 GB)"
182
  )
183
 
184
  if uploaded_file is not None: