You are exceeding the per-file limit of 2GB for Github Free.
If you don’t need to actually keep track of changes to that file, you could serve it from somewhere else and download it once when the app runs for the first time. Something like:
import os
import shutil
import requests
import streamlit as st
bigfile_name = "my_file.pkl"
if not os.path.exists(bigfile_name):
with st.spinner("Downloading..."):
# URL to a publicly accessible link
url = "https://drive.google.com/uc?id=<YOUR-FILE-ID>&export=download&confirm=yes"
# Download and save
with requests.get(url, stream=True) as r, open(bigfile_name, "wb") as f:
shutil.copyfileobj(r.raw, f)
st.title("My App")
st.write(f"Size of `{bigfile_name}` is {os.path.getsize(bigfile_name) / 1024:.1f} KB") # Show file size