YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
WIP
- ์์ง ์์ ์ค์ ๋๋ค.. ๋ชจ๋ธ์ ๋ฌธ์ ๊ฐ ์ข ์์ ใ original model: 42dot/42dot_LLM-PLM-1.3B
์ฌ์ฉ ์์
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "heegyu/42dot_LLM-PLM-1.3B-mt"
model = AutoModelForCausalLM.from_pretrained(model_id).eval().half()
tokenizer = AutoTokenizer.from_pretrained(model_id)
if torch.cuda.is_available():
device = "cuda:0"
model.to(device)
else:
device = "cpu"
@torch.no_grad()
def generate_text(prompt):
input_ids = tokenizer.encode(prompt, return_tensors="pt", add_special_tokens=False).to(device)
output_ids = model.generate(input_ids, min_new_tokens=4, max_length=1024, early_stopping=True)
output_ids = output_ids.cpu()[0][len(input_ids[0]):]
print(tokenizer.decode(output_ids))
bos, eos = tokenizer.bos_token, tokenizer.eos_token
# ํ -> ์
text = "์ผ์ฑ์ ์๊ฐ ๊ฐค๋ญ์ ์ค๋งํธํฐยทํ๋ธ๋ฆฟ ์ ์ฉ โํด๋ผ์ฐ๋ ๊ฒ์ ํ๋ซํผโ์ ์ด๋ฅด๋ฉด ์ด๋ฌ ๊ณต๊ฐํ๋ค. ์ ์ธ๊ณ 10์ต ๋ช
์ ๊ฐค๋ญ์ ์ฌ์ฉ์๊ฐ ์ฝ์(๊ฒ์๊ธฐ)์ ๊ตฌ๋งคํ๊ฑฐ๋ ๊ฒ์ ์ฑ์ ๋ด๋ ค๋ฐ์ง ์์๋ ์ค๋งํธํฐ์ ํตํด ์ค์๊ฐ์ผ๋ก ์ ๋ช
๊ฒ์์ ์ฆ๊ธธ ์ ์๊ฒ ๋๋ ๊ฒ์ด๋ค. ๊ธฐ๊ธฐ ํ๋งค์ ์์กดํ์ง ์๊ณ ์์ ์ ์ธ ์๋น์ค ์์ต์ ์ฌ๋ฆฌ๋ ค๋ ์ผ์ฑ์ ์์ โ์ ์ฌ์
์น๋ถ์โ๋ ํ๊ฐ๊ฐ ๋์จ๋ค."
generate_text(f"{bos} {text} {eos} ")
# ใSamsung Electronics will release the Cloud Game Platform for Galaxy smartphones and tablets in early this month, allowing users of 1 billion people around the world to enjoy famous games on their smartphones in real time without buying consoles or downloading game apps. It is said to be a 'business move' by Samsung Electronics, which is trying to earn stable service revenue without relying on sales.<|endoftext|>
# ์ -> ํ, ๋ง์ง๋ง ๋ฌธ์ฅ ์งค๋ ธ์
text = """Samsung Electronics will unveil a "cloud game platform" exclusively for Galaxy smartphones and tablets as early as this month. One billion Galaxy users around the world will be able to enjoy famous games in real time through smartphones without having to purchase consoles or download game apps. Analysts say that Samsung Electronics is a "new business winning move" to earn stable service profits without relying on device sales."""
generate_text(f"{bos} {text} {eos} ")
# ๏ผฎ๏ผฃ๋ ์ด๋ฌ ์ค ๊ฐค๋ญ์ ์ค๋งํธํฐ๊ณผ ํ๋ธ๋ฆฟ ์ ์ฉ 'ํด๋ผ์ฐ๋ ๊ฒ์ ํ๋ซํผ'์ ๋
์ ๊ณต๊ฐํ ์์ ์ธ๋ฐ, ์ ์ธ๊ณ 1์ต๋ช
์ ๊ฐค๋ญ์ ์ฌ์ฉ์๋ค์ ์ฝ์์ด๋ ๊ฒ์ ์ฑ ๋ค์ด๋ก๋ ์์ด ์ค๋งํธํฐ์ ํตํด ์ ๋ช
๊ฒ์์ ์ค์๊ฐ์ผ๋ก ์ฆ๊ธธ ์ ์๊ฒ ๋๋ค.<|endoftext|>
# ์ -> ํ, ์์ ๋ฒ์ญํ ๋จ์ด๋ฅผ ์ง์ ํ ์ ์๋ค.
text = """Samsung Electronics will unveil a "cloud game platform" exclusively for Galaxy smartphones and tablets as early as this month."""
generate_text(f"{bos} Samsung Electronics {eos} ์ผ์ฑ์ ์ {eos} {bos} {text} {eos} ")
# ๏ผฎ๊ฐ์ ์ผ์ฑ์ ์๊ฐ ๊ฐค๋ญ์ ์ค๋งํธํฐ๊ณผ ํ๋ธ๋ฆฟ ์ ์ฉ 'ํด๋ผ์ฐ๋ ๊ฒ์ ํ๋ซํผ'์ ์ด๋ฌ ์ค์ผ๋ก ๊ณต๊ฐํ๋ค.<|endoftext|>
๋ชจ๋ธ ํ๊ฐ
python main.py \
--model hf-causal \
--model_args pretrained=heegyu/42dot_LLM-PLM-1.3B-mt \
--tasks kobest_hellaswag,kobest_copa,kobest_boolq,kobest_sentineg \
--device cuda:0
- boolq, copa, hellaswag์ ์๋ณธ ๋ชจ๋ธ๋ณด๋ค ๊ฐ์ํ๋ค.
- sentineg๋ ํฌ๊ฒ ํฅ์
hf-causal (pretrained=heegyu/42dot_LLM-PLM-1.3B-mt), limit: None, provide_description: False, num_fewshot: 0, batch_size: None
| Task | Version | Metric | Value | Stderr | |
|---|---|---|---|---|---|
| kobest_boolq | 0 | acc | 0.5021 | ยฑ | 0.0133 |
| macro_f1 | 0.3343 | ยฑ | 0.0059 | ||
| kobest_copa | 0 | acc | 0.6640 | ยฑ | 0.0149 |
| macro_f1 | 0.6633 | ยฑ | 0.0149 | ||
| kobest_hellaswag | 0 | acc | 0.4020 | ยฑ | 0.0219 |
| acc_norm | 0.5220 | ยฑ | 0.0224 | ||
| macro_f1 | 0.3974 | ยฑ | 0.0218 | ||
| kobest_sentineg | 0 | acc | 0.8010 | ยฑ | 0.0201 |
| macro_f1 | 0.8003 | ยฑ | 0.0201 |
- Downloads last month
- 8