Spaces:
Running
Running
pragnakalp
commited on
Commit
•
5e70902
1
Parent(s):
8d39233
Update app.py
Browse files
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 |
-
|
47 |
-
|
48 |
-
#
|
49 |
-
|
|
|
|
|
|
|
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 = ''
|