RealSanjay commited on
Commit
b642dca
·
verified ·
1 Parent(s): 701919b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -17,8 +17,11 @@ stop_event = threading.Event()
17
 
18
  def initialize_model():
19
  """Initialize Whisper model and AI detectors."""
20
- st.session_state.model = WhisperModel(model_size="small", device="cpu", compute_type="int8")
21
- st.session_state.ai_detector = pipeline('text-classification', model='roberta-base-openai-detector')
 
 
 
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."""