Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -74,6 +74,10 @@ def check_environment():
|
|
| 74 |
# Run environment check
|
| 75 |
check_environment()
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
# Main title and description
|
| 78 |
st.title("Deepfake Image Analyser")
|
| 79 |
st.markdown("Analyse images for deepfake manipulation")
|
|
@@ -88,6 +92,26 @@ def check_gpu():
|
|
| 88 |
st.sidebar.warning("⚠️ No GPU detected. Analysis will be slower.")
|
| 89 |
return False
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
# Sidebar components
|
| 92 |
st.sidebar.title("About")
|
| 93 |
st.sidebar.markdown("""
|
|
|
|
| 74 |
# Run environment check
|
| 75 |
check_environment()
|
| 76 |
|
| 77 |
+
# Run Hugging Face Hub connectivity test
|
| 78 |
+
if st.session_state.debug:
|
| 79 |
+
test_huggingface_hub_access()
|
| 80 |
+
|
| 81 |
# Main title and description
|
| 82 |
st.title("Deepfake Image Analyser")
|
| 83 |
st.markdown("Analyse images for deepfake manipulation")
|
|
|
|
| 92 |
st.sidebar.warning("⚠️ No GPU detected. Analysis will be slower.")
|
| 93 |
return False
|
| 94 |
|
| 95 |
+
# Test Hugging Face Hub connectivity
|
| 96 |
+
def test_huggingface_hub_access():
|
| 97 |
+
"""Test connectivity to the Hugging Face Hub"""
|
| 98 |
+
try:
|
| 99 |
+
from huggingface_hub import HfApi
|
| 100 |
+
api = HfApi()
|
| 101 |
+
|
| 102 |
+
# Try to get info for a public model
|
| 103 |
+
model_info = api.model_info("openai/clip-vit-base-patch32")
|
| 104 |
+
|
| 105 |
+
# If we get here, access worked
|
| 106 |
+
st.sidebar.success("✅ Hugging Face Hub connectivity: Good")
|
| 107 |
+
return True
|
| 108 |
+
except Exception as e:
|
| 109 |
+
st.sidebar.error(f"⚠️ Hugging Face Hub connectivity issue: {str(e)}")
|
| 110 |
+
if st.session_state.debug:
|
| 111 |
+
import traceback
|
| 112 |
+
st.sidebar.error(traceback.format_exc())
|
| 113 |
+
return False
|
| 114 |
+
|
| 115 |
# Sidebar components
|
| 116 |
st.sidebar.title("About")
|
| 117 |
st.sidebar.markdown("""
|