Spaces:
Sleeping
Sleeping
ronald
commited on
Commit
·
f03b3f6
1
Parent(s):
6a45dac
coh mech
Browse files- ccl_win.py +2 -2
ccl_win.py
CHANGED
@@ -116,6 +116,7 @@ class ccl_win(evaluate.Measurement):
|
|
116 |
def _compute(self, predictions, dataset, batch_size: int = 16, device=None):
|
117 |
"""Returns the scores"""
|
118 |
MODEL_CACHE_DIR = "/home/rcardena/.cache/huggingface/"
|
|
|
119 |
if getpass.getuser() == "s1987051":
|
120 |
MODEL_CACHE_DIR="/disk/ocean/rcardenas/tools/huggingface/"
|
121 |
elif getpass.getuser() == "rcardena":
|
@@ -128,12 +129,11 @@ class ccl_win(evaluate.Measurement):
|
|
128 |
else:
|
129 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
130 |
|
131 |
-
cur_dir = os.path.dirname(__file__)
|
132 |
tokenizer = AutoTokenizer.from_pretrained("roberta-large")
|
133 |
|
134 |
pdb.set_trace()
|
135 |
|
136 |
-
model = AutoModelForSequenceClassification.from_pretrained(os.path.join(
|
137 |
model.to(device)
|
138 |
|
139 |
pred_list,len_by_sample = self.preprocess_adjacent_window(preds)
|
|
|
116 |
def _compute(self, predictions, dataset, batch_size: int = 16, device=None):
|
117 |
"""Returns the scores"""
|
118 |
MODEL_CACHE_DIR = "/home/rcardena/.cache/huggingface/"
|
119 |
+
BASEDIR = "/gfs/team/nlp/users/rcardena/tools/new_evals/ccl_win"
|
120 |
if getpass.getuser() == "s1987051":
|
121 |
MODEL_CACHE_DIR="/disk/ocean/rcardenas/tools/huggingface/"
|
122 |
elif getpass.getuser() == "rcardena":
|
|
|
129 |
else:
|
130 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
131 |
|
|
|
132 |
tokenizer = AutoTokenizer.from_pretrained("roberta-large")
|
133 |
|
134 |
pdb.set_trace()
|
135 |
|
136 |
+
model = AutoModelForSequenceClassification.from_pretrained(os.path.join(BASEDIR,dataset))
|
137 |
model.to(device)
|
138 |
|
139 |
pred_list,len_by_sample = self.preprocess_adjacent_window(preds)
|