Kevin Fink
commited on
Commit
·
730452f
1
Parent(s):
7bceaa3
deve
Browse files
app.py
CHANGED
@@ -46,6 +46,8 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
|
|
46 |
result = {k: round(v * 100, 4) for k, v in result.items()}
|
47 |
prediction_lens = [np.count_nonzero(pred != tokenizer.pad_token_id) for pred in preds]
|
48 |
result["gen_len"] = np.mean(prediction_lens)
|
|
|
|
|
49 |
return result
|
50 |
|
51 |
login(api_key.strip())
|
@@ -222,7 +224,7 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
|
|
222 |
train_dataset=train_set['train'],
|
223 |
eval_dataset=train_set['validation'],
|
224 |
compute_metrics=compute_metrics,
|
225 |
-
|
226 |
#processing_class=tokenizer,
|
227 |
)
|
228 |
|
|
|
46 |
result = {k: round(v * 100, 4) for k, v in result.items()}
|
47 |
prediction_lens = [np.count_nonzero(pred != tokenizer.pad_token_id) for pred in preds]
|
48 |
result["gen_len"] = np.mean(prediction_lens)
|
49 |
+
accuracy = accuracy_score(decoded_labels, decoded_preds)
|
50 |
+
result["accuracy"] = round(accuracy * 100, 4)
|
51 |
return result
|
52 |
|
53 |
login(api_key.strip())
|
|
|
224 |
train_dataset=train_set['train'],
|
225 |
eval_dataset=train_set['validation'],
|
226 |
compute_metrics=compute_metrics,
|
227 |
+
sdata_collator=data_collator,
|
228 |
#processing_class=tokenizer,
|
229 |
)
|
230 |
|