File size: 654 Bytes
8d40b7e
 
 
 
 
 
a1f00b9
 
3a5a8d0
 
a1f00b9
3a5a8d0
a1f00b9
3a5a8d0
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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