Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,8 +17,11 @@ stop_event = threading.Event()
|
|
17 |
|
18 |
def initialize_model():
|
19 |
"""Initialize Whisper model and AI detectors."""
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
22 |
|
23 |
def advanced_ai_detection(text, ai_detector):
|
24 |
"""Perform AI detection on the text."""
|
|
|
17 |
|
18 |
def initialize_model():
|
19 |
"""Initialize Whisper model and AI detectors."""
|
20 |
+
try:
|
21 |
+
st.session_state.model = WhisperModel("small", device="cpu", compute_type="int8")
|
22 |
+
st.session_state.ai_detector = pipeline('text-classification', model='roberta-base-openai-detector')
|
23 |
+
except Exception as e:
|
24 |
+
st.error(f"Error initializing models: {str(e)}")
|
25 |
|
26 |
def advanced_ai_detection(text, ai_detector):
|
27 |
"""Perform AI detection on the text."""
|