matsuo-lab/weblab-10b

Model

weblab-10b

66

18 commits

3 linked in READMEs

updated Sep 4, 2023

See the code

README

weblab-10b

Overview

This repository provides a Japanese-centric multilingual GPT-NeoX model of 10 billion parameters.


Benchmarking

  • Japanese benchmark : JGLUE 8-task (2023-08-27)

    • We used Stability-AI/lm-evaluation-harness library for evaluation.
    • The 8-task average accuracy is based on results of JCommonsenseQA-1.1, JNLI-1.1, MARC-ja-1.1, JSQuAD-1.1, jaqket_v2-0.2, xlsum_ja-1.0, xwinograd_ja, and mgsm-1.0.
    • model loading is performed with float16, and evaluation is performed with template version 0.3 using the few-shot in-context learning.
    • The number of few-shots is 3,3,3,2,1,1,0,5.
    • special_tokens_map.json is modified to avoid errors during the evaluation of the second half benchmarks. As a result, the results of the first half benchmarks became slightly different.
    modelaveragejcommonsenseqajnlimarc_jajsquadjaqket_v2xlsum_jaxwinograd_jamgsm
    weblab-10b-instruction-sft59.1174.6266.5695.4978.3463.3220.5771.952
    weblab-10b50.7466.5853.7482.0762.9456.1910.0371.952.4
  • Japanese benchmark : JGLUE 4-task (2023-08-18)

    • We used Stability-AI/lm-evaluation-harness library for evaluation.
    • The 4-task average accuracy is based on results of JCommonsenseQA-1.1, JNLI-1.1, MARC-ja-1.1, and JSQuAD-1.1.
    • model loading is performed with float16, and evaluation is performed with template version 0.3 using the few-shot in-context learning.
    • The number of few-shots is 3,3,3,2.
    ModelAverageJCommonsenseQAJNLIMARC-jaJSQuAD
    weblab-10b-instruction-sft78.7874.3565.6596.0679.04
    weblab-10b66.3865.8654.1984.4960.98

How to use the model

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("matsuo-lab/weblab-10b")
model = AutoModelForCausalLM.from_pretrained("matsuo-lab/weblab-10b", torch_dtype=torch.float16)

if torch.cuda.is_available():
    model = model.to("cuda")

text = "吾輩は猫である。"
token_ids = tokenizer.encode(text, add_special_tokens=False, return_tensors="pt")

with torch.no_grad():
    output_ids = model.generate(
        token_ids.to(model.device),
        max_new_tokens=100,
        do_sample=True,
        temperature=0.7,
        top_p=0.95
    )

output = tokenizer.decode(output_ids.tolist()[0])
print(output)


Licenese

cc-by-nc-4.0

endpoints_compatible
gpt_neox
pytorch
text-generation
text-generation-inference
transformers

Contributors

matsuo-lab

11 commits

TK

matsuo-lab/weblab-10b

Model

weblab-10b

66

18 commits

3 linked in READMEs

updated Sep 4, 2023

See the code

README

weblab-10b

Overview

This repository provides a Japanese-centric multilingual GPT-NeoX model of 10 billion parameters.


Benchmarking

  • Japanese benchmark : JGLUE 8-task (2023-08-27)

    • We used Stability-AI/lm-evaluation-harness library for evaluation.
    • The 8-task average accuracy is based on results of JCommonsenseQA-1.1, JNLI-1.1, MARC-ja-1.1, JSQuAD-1.1, jaqket_v2-0.2, xlsum_ja-1.0, xwinograd_ja, and mgsm-1.0.
    • model loading is performed with float16, and evaluation is performed with template version 0.3 using the few-shot in-context learning.
    • The number of few-shots is 3,3,3,2,1,1,0,5.
    • special_tokens_map.json is modified to avoid errors during the evaluation of the second half benchmarks. As a result, the results of the first half benchmarks became slightly different.
    modelaveragejcommonsenseqajnlimarc_jajsquadjaqket_v2xlsum_jaxwinograd_jamgsm
    weblab-10b-instruction-sft59.1174.6266.5695.4978.3463.3220.5771.952
    weblab-10b50.7466.5853.7482.0762.9456.1910.0371.952.4
  • Japanese benchmark : JGLUE 4-task (2023-08-18)

    • We used Stability-AI/lm-evaluation-harness library for evaluation.
    • The 4-task average accuracy is based on results of JCommonsenseQA-1.1, JNLI-1.1, MARC-ja-1.1, and JSQuAD-1.1.
    • model loading is performed with float16, and evaluation is performed with template version 0.3 using the few-shot in-context learning.
    • The number of few-shots is 3,3,3,2.
    ModelAverageJCommonsenseQAJNLIMARC-jaJSQuAD
    weblab-10b-instruction-sft78.7874.3565.6596.0679.04
    weblab-10b66.3865.8654.1984.4960.98

How to use the model

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("matsuo-lab/weblab-10b")
model = AutoModelForCausalLM.from_pretrained("matsuo-lab/weblab-10b", torch_dtype=torch.float16)

if torch.cuda.is_available():
    model = model.to("cuda")

text = "吾輩は猫である。"
token_ids = tokenizer.encode(text, add_special_tokens=False, return_tensors="pt")

with torch.no_grad():
    output_ids = model.generate(
        token_ids.to(model.device),
        max_new_tokens=100,
        do_sample=True,
        temperature=0.7,
        top_p=0.95
    )

output = tokenizer.decode(output_ids.tolist()[0])
print(output)


Licenese

cc-by-nc-4.0

endpoints_compatible
gpt_neox
pytorch
text-generation
text-generation-inference
transformers

Contributors

matsuo-lab

11 commits

TK