Spaces:
Running
Running
pragnakalp
commited on
Commit
•
2fa5683
1
Parent(s):
db27c83
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,8 @@ import pandas as pd
|
|
12 |
|
13 |
from huggingface_hub import Repository
|
14 |
from urllib.request import urlopen
|
15 |
-
from transformers import AutoTokenizer, AutoModelWithLMHead
|
|
|
16 |
|
17 |
## connection with HF datasets
|
18 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
@@ -43,7 +44,9 @@ SENTENCES_VALUE = """Raj loves Simran.\nLast year I lost my Dog.\nI bought a new
|
|
43 |
cwd = os.getcwd()
|
44 |
model_path = os.path.join(cwd)
|
45 |
tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-emotion")
|
46 |
-
model_base = AutoModelWithLMHead.from_pretrained(model_path)
|
|
|
|
|
47 |
|
48 |
def getIP():
|
49 |
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")
|
|
|
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 = ''
|