dfimgdetector / src /core /inference.py
mangalaparida's picture
Update src/core/inference.py
26273a9 verified
Raw
History Blame Contribute Delete
654 Bytes
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