d-Matrix
commited on
Delete test.py
Browse files
test.py
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
import evaluate
|
2 |
-
from datasets import load_dataset
|
3 |
-
from transformers import AutoModelForCausalLM
|
4 |
-
|
5 |
-
perplexity = evaluate.load("d-matrix/dmx_perplexity", module_type="metric")
|
6 |
-
input_texts = load_dataset("wikitext", "wikitext-2-raw-v1", split="test")["text"][:10]
|
7 |
-
model = AutoModelForCausalLM.from_pretrained(
|
8 |
-
pretrained_model_name_or_path="d-matrix/gpt-j-6b",
|
9 |
-
# trust_remote_code=True,
|
10 |
-
device_map="auto",
|
11 |
-
use_auth_token=True,
|
12 |
-
)
|
13 |
-
results = perplexity.compute(model=model, references=input_texts)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|