rviana commited on
Commit
eed2c8b
·
1 Parent(s): 924dfb2

Add Model.

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -1,8 +1,16 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
  import streamlit as st
4
  import socket
5
 
 
 
 
 
 
 
 
 
 
6
  # Specify the model name explicitly to avoid warnings
7
  model_name = "distilbert-base-uncased-finetuned-sst-2-english"
8
 
 
1
  import gradio as gr
 
2
  import streamlit as st
3
  import socket
4
 
5
+ try:
6
+ from transformers import pipeline
7
+ except ImportError as e:
8
+ st.error(f"ImportError: {e}")
9
+ st.stop()
10
+ except Exception as e:
11
+ st.error(f"Unexpected error: {e}")
12
+ st.stop()
13
+
14
  # Specify the model name explicitly to avoid warnings
15
  model_name = "distilbert-base-uncased-finetuned-sst-2-english"
16