Views
No views yet
| Task | Version | Metric | Value | Stderr | |
|---|---|---|---|---|---|
| pubmedqa | 0 | acc | 0.536 | ± | 0.0223 |
| arc_challenge | 0 | acc_norm | 0.2867 | ± | 0.0132 |
| arc_easy | 0 | acc | 0.5804 | ± | 0.0101 |
| arc_easy | 0 | acc_norm | 0.5707 | ± | 0.0102 |
| winogrande | 0 | acc | 0.5691 | ± | 0.0139 |
| truthfulqa_mc | 1 | mc2 | 0.3918 | ± | 0.0144 |
| anli_r1 | 0 | acc | 0.338 | ± | 0.0150 |
| anli_r2 | 0 | acc | 0.346 | ± | 0.0151 |
| anli_r3 | 0 | acc | 0.355 | ± | 0.0138 |
| drop | 1 | f1 | 0.0034 | ± | 0.0004 |
| hendrycksTest-abstract_algebra | 1 | acc | 0.32 | ± | 0.0952 |
| hendrycksTest-anatomy | 1 | acc | 0.44 | ± | 0.1013 |
| hendrycksTest-astronomy | 1 | acc | 0.24 | ± | 0.0872 |
| hendrycksTest-business_ethics | 1 | acc | 0.24 | ± | 0.0872 |
| hendrycksTest-clinical_knowledge | 1 | acc | 0.24 | ± | 0.0872 |
| hendrycksTest-college_biology | 1 | acc | 0.20 | ± | 0.0816 |
| hendrycksTest-college_chemistry | 1 | acc | 0.40 | ± | 0.1000 |
| hendrycksTest-college_computer_science | 1 | acc | 0.36 | ± | 0.0980 |
| hendrycksTest-college_mathematics | 1 | acc | 0.48 | ± | 0.1020 |
| hendrycksTest-college_medicine | 1 | acc | 0.20 | ± | 0.0816 |
| hendrycksTest-college_physics | 1 | acc | 0.44 | ± | 0.1013 |
| hendrycksTest-computer_security | 1 | acc | 0.16 | ± | 0.0748 |
| hendrycksTest-conceptual_physics | 1 | acc | 0.12 | ± | 0.0663 |
| hendrycksTest-econometrics | 1 | acc | 0.16 | ± | 0.0748 |
| hendrycksTest-electrical_engineering | 1 | acc | 0.28 | ± | 0.0917 |
| hendrycksTest-elementary_mathematics | 1 | acc | 0.36 | ± | 0.0980 |
| hendrycksTest-formal_logic | 1 | acc | 0.44 | ± | 0.1013 |
| hendrycksTest-global_facts | 1 | acc | 0.20 | ± | 0.0816 |
| hendrycksTest-high_school_biology | 1 | acc | 0.20 | ± | 0.0816 |
| hendrycksTest-high_school_chemistry | 1 | acc | 0.28 | ± | 0.0917 |
| hendrycksTest-high_school_computer_science | 1 | acc | 0.24 | ± | 0.0872 |
| hendrycksTest-high_school_european_history | 1 | acc | 0.32 | ± | 0.0952 |
| hendrycksTest-high_school_geography | 1 | acc | 0.32 | ± | 0.0952 |
| hendrycksTest-high_school_government_and_politics | 1 | acc | 0.28 | ± | 0.0917 |
| hendrycksTest-high_school_macroeconomics | 1 | acc | 0.28 | ± | 0.0917 |
| hendrycksTest-high_school_mathematics | 1 | acc | 0.20 | ± | 0.0816 |
| hendrycksTest-high_school_microeconomics | 1 | acc | 0.24 | ± | 0.0872 |
| hendrycksTest-high_school_physics | 1 | acc | 0.28 | ± | 0.0917 |
| hendrycksTest-high_school_psychology | 1 | acc | 0.32 | ± | 0.0952 |
| hendrycksTest-high_school_statistics | 1 | acc | 0.40 | ± | 0.1000 |
| hendrycksTest-high_school_us_history | 1 | acc | 0.32 | ± | 0.0952 |
| hendrycksTest-high_school_world_history | 1 | acc | 0.36 | ± | 0.0980 |
| hendrycksTest-human_aging | 1 | acc | 0.16 | ± | 0.0748 |
| hendrycksTest-human_sexuality | 1 | acc | 0.40 | ± | 0.1000 |
| hendrycksTest-international_law | 1 | acc | 0.24 | ± | 0.0872 |
| hendrycksTest-jurisprudence | 1 | acc | 0.08 | ± | 0.0554 |
| hendrycksTest-logical_fallacies | 1 | acc | 0.52 | ± | 0.1020 |
| hendrycksTest-machine_learning | 1 | acc | 0.12 | ± | 0.0663 |
| hendrycksTest-management | 1 | acc | 0.12 | ± | 0.0663 |
| hendrycksTest-marketing | 1 | acc | 0.16 | ± | 0.0748 |
| hendrycksTest-medical_genetics | 1 | acc | 0.12 | ± | 0.0663 |
| hendrycksTest-miscellaneous | 1 | acc | 0.36 | ± | 0.0980 |
| hendrycksTest-moral_disputes | 1 | acc | 0.08 | ± | 0.0554 |
| hendrycksTest-moral_scenarios | 1 | acc | 0.44 | ± | 0.1013 |
| hendrycksTest-nutrition | 1 | acc | 0.32 | ± | 0.0952 |
| hendrycksTest-philosophy | 1 | acc | 0.44 | ± | 0.1013 |
| hendrycksTest-prehistory | 1 | acc | 0.16 | ± | 0.0748 |
| hendrycksTest-professional_accounting | 1 | acc | 0.28 | ± | 0.0917 |
| hendrycksTest-professional_law | 1 | acc | 0.12 | ± | 0.0663 |
| hendrycksTest-professional_medicine | 1 | acc | 0.40 | ± | 0.1000 |
| hendrycksTest-professional_psychology | 1 | acc | 0.24 | ± | 0.0872 |
| hendrycksTest-public_relations | 1 | acc | 0.08 | ± | 0.0554 |
| hendrycksTest-security_studies | 1 | acc | 0.24 | ± | 0.0872 |
| hendrycksTest-sociology | 1 | acc | 0.28 | ± | 0.0917 |
| hendrycksTest-us_foreign_policy | 1 | acc | 0.24 | ± | 0.0872 |
| hendrycksTest-virology | 1 | acc | 0.20 | ± | 0.0816 |
| hendrycksTest-world_religions | 1 | acc | 0.16 | ± | 0.0748 |
1import torch
2from transformers import GPT2LMHeadModel, AutoTokenizer
3tokenizer = AutoTokenizer.from_pretrained("Locutusque/gpt2-xl-conversational")
4model = GPT2LMHeadModel.from_pretrained("Locutusque/gpt2-xl-conversational", torch_dtype=torch.float16)
5model.resize_token_embeddings(len(tokenizer))
6device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
7model.to(device, dtype=torch.float32)
8def generate_text(model: SENTIAForCausalLM, tokenizer, prompt, max_length=256):
9 prompt = f'<|USER|> {prompt} <|ASSISTANT|> '
10 input_ids = tokenizer.encode(prompt, add_special_tokens=True, max_length=max_length, truncation=True, return_tensors="pt").to(device)
11 output = model.generate(input_ids, do_sample=True, temperature=0.3, top_p=0.7, top_k=23, repetition_penalty=1.176, max_length=max_length, pad_token_id=tokenizer.pad_token_id, eos_token_id=tokenizer.eos_token_id)
12 output_ids = tokenizer.decode(output[0], skip_special_tokens=False)
13 return output_ids
14# Loop to interact with the model
15while True:
16 prompt = input("Enter a prompt (or 'q' to quit): ")
17 if prompt == "q":
18 break
19 output_text = generate_text(model, tokenizer, prompt, max_length=1022)
20 print(output_text)
21
22"<|USER|> {user prompt} <|ASSISTANT|> {model prediction} ".