Spaces:
Sleeping
Sleeping
Update mmlu_eval.py
Browse files- mmlu_eval.py +2 -0
mmlu_eval.py
CHANGED
@@ -3,6 +3,7 @@ import random
|
|
3 |
import evaluate
|
4 |
from datasets import load_dataset
|
5 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
|
6 |
|
7 |
# Load Accuracy Metric
|
8 |
accuracy_metric = evaluate.load("accuracy")
|
@@ -10,6 +11,7 @@ accuracy_metric = evaluate.load("accuracy")
|
|
10 |
# Load MMLU dataset
|
11 |
mmlu_dataset = load_dataset("cais/mmlu", "all")
|
12 |
|
|
|
13 |
def generate_answer(model, tokenizer, question):
|
14 |
"""
|
15 |
Generates an answer using Mistral's instruction format.
|
|
|
3 |
import evaluate
|
4 |
from datasets import load_dataset
|
5 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
6 |
+
import spaces
|
7 |
|
8 |
# Load Accuracy Metric
|
9 |
accuracy_metric = evaluate.load("accuracy")
|
|
|
11 |
# Load MMLU dataset
|
12 |
mmlu_dataset = load_dataset("cais/mmlu", "all")
|
13 |
|
14 |
+
@spaces.GPU
|
15 |
def generate_answer(model, tokenizer, question):
|
16 |
"""
|
17 |
Generates an answer using Mistral's instruction format.
|