Views
No views yet

1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
3
4MODEL_DIR = "chihoonlee10/T3Q-LLM-MG-v1.0"
5model = AutoModelForCausalLM.from_pretrained(MODEL_DIR, torch_dtype=torch.float16).to("cuda")
6tokenizer = AutoTokenizer.from_pretrained(MODEL_DIR)
7streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
8
9s = "한국의 수도는 어디?"
10conversation = [{'role': 'user', 'content': s}]
11inputs = tokenizer.apply_chat_template(
12 conversation,
13 tokenize=True,
14 add_generation_prompt=True,
15 return_tensors='pt').to("cuda")
16_ = model.generate(inputs, streamer=streamer, max_new_tokens=1024)
17| Task | Version | Metric | Value | Stderr | |
|---|---|---|---|---|---|
| kobest_boolq | 0 | acc | 0.9523 | ± | 0.0057 |
| macro_f1 | 0.9523 | ± | 0.0057 | ||
| kobest_copa | 0 | acc | 0.7740 | ± | 0.0132 |
| macro_f1 | 0.7737 | ± | 0.0133 | ||
| kobest_hellaswag | 0 | acc | 0.4980 | ± | 0.0224 |
| acc_norm | 0.5920 | ± | 0.0220 | ||
| macro_f1 | 0.4950 | ± | 0.0223 | ||
| kobest_sentineg | 0 | acc | 0.7254 | ± | 0.0224 |
| macro_f1 | 0.7106 | ± | 0.0234 |
| Task | Version | Metric | Value | Stderr | |
|---|---|---|---|---|---|
| kobest_boolq | 0 | acc | 0.9387 | ± | 0.0064 |
| macro_f1 | 0.9387 | ± | 0.0064 | ||
| kobest_copa | 0 | acc | 0.7590 | ± | 0.0135 |
| macro_f1 | 0.7585 | ± | 0.0135 | ||
| kobest_hellaswag | 0 | acc | 0.5080 | ± | 0.0224 |
| acc_norm | 0.5580 | ± | 0.0222 | ||
| macro_f1 | 0.5049 | ± | 0.0224 | ||
| kobest_sentineg | 0 | acc | 0.8489 | ± | 0.0180 |
| macro_f1 | 0.8483 | ± | 0.0180 |