Spaces:
Running
Running
pragnakalp
commited on
Commit
•
cb8109a
1
Parent(s):
5e70902
Update app.py
Browse files
app.py
CHANGED
@@ -12,8 +12,8 @@ import pandas as pd
|
|
12 |
|
13 |
from huggingface_hub import Repository
|
14 |
from urllib.request import urlopen
|
15 |
-
|
16 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
17 |
|
18 |
## connection with HF datasets
|
19 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
@@ -43,13 +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 |
-
try:
|
47 |
-
|
48 |
-
|
49 |
# Instead of AutoModelWithLMHead
|
50 |
-
model_base = AutoModelForCausalLM.from_pretrained(model_path)
|
51 |
-
except Exception as e:
|
52 |
-
|
53 |
|
54 |
def getIP():
|
55 |
ip_address = ''
|
|
|
12 |
|
13 |
from huggingface_hub import Repository
|
14 |
from urllib.request import urlopen
|
15 |
+
from transformers import AutoTokenizer, AutoModelWithLMHead
|
16 |
+
# from transformers import AutoModelForCausalLM, AutoTokenizer
|
17 |
|
18 |
## connection with HF datasets
|
19 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
|
|
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 = ''
|