pragnakalp commited on
Commit
5e70902
1 Parent(s): 8d39233

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -43,10 +43,13 @@ SENTENCES_VALUE = """Raj loves Simran.\nLast year I lost my Dog.\nI bought a new
43
  ## load model
44
  cwd = os.getcwd()
45
  model_path = os.path.join(cwd)
46
- tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-emotion")
47
- # model_base = AutoModelWithLMHead.from_pretrained(model_path)
48
- # Instead of AutoModelWithLMHead
49
- model_base = AutoModelForCausalLM.from_pretrained(model_path)
 
 
 
50
 
51
  def getIP():
52
  ip_address = ''
 
43
  ## load model
44
  cwd = os.getcwd()
45
  model_path = os.path.join(cwd)
46
+ try:
47
+ tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-emotion")
48
+ # model_base = AutoModelWithLMHead.from_pretrained(model_path)
49
+ # Instead of AutoModelWithLMHead
50
+ model_base = AutoModelForCausalLM.from_pretrained(model_path)
51
+ except Exception as e:
52
+ print(f"Error loading model: {e}")
53
 
54
  def getIP():
55
  ip_address = ''