import streamlit as st from transformers import pipeline @st.cache_resource def load_deepfake_model(): model_name = "mangalaparida/dfimgdetection" try: # Try without token first (for public model) pipe = pipeline("image-classification", model=model_name) return pipe except Exception as e: st.warning("Public access failed, trying with token...") try: pipe = pipeline( "image-classification", model=model_name, ) return pipe except Exception as e: st.error(f"Model loading failed: {e}") return None