kraghavendra99 commited on
Commit
d0fd2a3
Β·
verified Β·
1 Parent(s): 440c7e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -5,13 +5,15 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification
5
  import numpy as np
6
 
7
  # ── Model loading ────────────────────────────────────────────────────────────
8
- MODEL_PATH = "./bertweet-sentiment-final" # path where you saved the model
 
9
 
10
  print("Loading BERTweet model...")
11
- tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH, normalization=True)
12
  model = AutoModelForSequenceClassification.from_pretrained(MODEL_PATH)
13
  model.eval()
14
 
 
15
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
16
  model = model.to(device)
17
  print(f"Model loaded on {device}")
 
5
  import numpy as np
6
 
7
  # ── Model loading ────────────────────────────────────────────────────────────
8
+
9
+ MODEL_PATH = "kraghavendra99/bertweet-sentiment-tweeteval"
10
 
11
  print("Loading BERTweet model...")
12
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
13
  model = AutoModelForSequenceClassification.from_pretrained(MODEL_PATH)
14
  model.eval()
15
 
16
+
17
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
18
  model = model.to(device)
19
  print(f"Model loaded on {device}")