Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +19 -0
src/streamlit_app.py
CHANGED
|
@@ -106,6 +106,25 @@ def main():
|
|
| 106 |
st.session_state['ai_tutor'] = ai_tutor
|
| 107 |
st.success(
|
| 108 |
"β
Fine-tuned model loaded successfully!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
except Exception as e:
|
| 110 |
st.error(
|
| 111 |
f"β CRITICAL ERROR: Failed to load fine-tuned model")
|
|
|
|
| 106 |
st.session_state['ai_tutor'] = ai_tutor
|
| 107 |
st.success(
|
| 108 |
"β
Fine-tuned model loaded successfully!")
|
| 109 |
+
except PermissionError as e:
|
| 110 |
+
st.error(
|
| 111 |
+
f"β CACHE PERMISSION ERROR: Model download blocked")
|
| 112 |
+
st.error(f"π Error Type: {type(e).__name__}")
|
| 113 |
+
st.error(f"π Error Message: {str(e)}")
|
| 114 |
+
st.error("π This usually means:")
|
| 115 |
+
st.error(
|
| 116 |
+
" 1. Another user is downloading the same model (wait 5-10 minutes)")
|
| 117 |
+
st.error(
|
| 118 |
+
" 2. A previous download was interrupted (cache needs clearing)")
|
| 119 |
+
st.error("π§ Solutions:")
|
| 120 |
+
st.error(" β’ Wait 5-10 minutes and try again")
|
| 121 |
+
st.error(
|
| 122 |
+
" β’ Restart your HF Space to clear cache")
|
| 123 |
+
st.error(
|
| 124 |
+
" β’ The model will download automatically on retry")
|
| 125 |
+
st.error(
|
| 126 |
+
"π‘ This is temporary - the model will load once cache is cleared")
|
| 127 |
+
st.stop()
|
| 128 |
except Exception as e:
|
| 129 |
st.error(
|
| 130 |
f"β CRITICAL ERROR: Failed to load fine-tuned model")
|