deepyuna commited on
Commit
404c948
·
verified ·
1 Parent(s): 226e1ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -71,6 +71,8 @@ from peft import PeftModel
71
  # result = app_module.main()
72
 
73
 
 
 
74
 
75
  # Helper function to clean up cache
76
  def clear_cache(cache_dir="private_space_cache"):
@@ -83,9 +85,6 @@ def clear_cache(cache_dir="private_space_cache"):
83
  except Exception as e:
84
  st.warning(f"Could not delete {file}: {e}")
85
 
86
- # Streamlit app setup
87
- st.title("Math Question Labeling Tool (Public Interface)")
88
-
89
  # Get environment variables
90
  HF_TOKEN_LLAMA = os.environ.get("HF_TOKEN_LLAMA")
91
  HF_TOKEN = os.environ.get("HF_TOKEN")
@@ -112,8 +111,8 @@ with st.spinner("Downloading private space..."):
112
  repo_type=REPO_TYPE,
113
  token=HF_TOKEN,
114
  cache_dir="private_space_cache",
115
- force_download=True, # Always redownload to avoid stale cache
116
- local_dir_use_symlinks=False # Avoid symlinks that might break
117
  )
118
  except Exception as e:
119
  st.error(f"Failed to download private space: {e}")
@@ -130,7 +129,7 @@ try:
130
  filename="app.py",
131
  repo_type=REPO_TYPE,
132
  token=HF_TOKEN,
133
- force_download=True # Ensure fresh download
134
  )
135
  except Exception as e:
136
  st.error(f"Failed to download app.py: {e}")
 
71
  # result = app_module.main()
72
 
73
 
74
+ # Set page config as the FIRST command
75
+ st.set_page_config(page_title="📐 Math Assignment Optimizer", layout="wide")
76
 
77
  # Helper function to clean up cache
78
  def clear_cache(cache_dir="private_space_cache"):
 
85
  except Exception as e:
86
  st.warning(f"Could not delete {file}: {e}")
87
 
 
 
 
88
  # Get environment variables
89
  HF_TOKEN_LLAMA = os.environ.get("HF_TOKEN_LLAMA")
90
  HF_TOKEN = os.environ.get("HF_TOKEN")
 
111
  repo_type=REPO_TYPE,
112
  token=HF_TOKEN,
113
  cache_dir="private_space_cache",
114
+ force_download=True,
115
+ local_dir_use_symlinks=False
116
  )
117
  except Exception as e:
118
  st.error(f"Failed to download private space: {e}")
 
129
  filename="app.py",
130
  repo_type=REPO_TYPE,
131
  token=HF_TOKEN,
132
+ force_download=True
133
  )
134
  except Exception as e:
135
  st.error(f"Failed to download app.py: {e}")