mangalaparida commited on
Commit
8d40b7e
·
verified ·
1 Parent(s): cbbe46f

Update src/core/inference.py

Browse files
Files changed (1) hide show
  1. src/core/inference.py +12 -0
src/core/inference.py CHANGED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ @st.cache_resource
5
+ def load_deepfake_model():
6
+ """
7
+ Loads the Hugging Face pipeline for deepfake detection.
8
+ Using `@st.cache_resource` ensures the model is only loaded once per session.
9
+ """
10
+ model_name = "mangalaparida/dfimgdetection"
11
+ pipe = pipeline("image-classification", model=model_name)
12
+ return pipe