Edit model card

这是什么 - Intro

中文 OPT-125m,在原 OPT-125m 模型基础上扩充了中文词表,并在 WebText, ShareGPT 等数据集上作了一定的继续预训练。

Chinese OPT-125m, expanding the Chinese word list based on the original OPT-125m model, and making some continued pre-training on WebText, ShareGPT, etc.

快速试用 - Quick Use

# 快速试用
# quick use
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name_or_path = 'Sholder/chinese-opt-125m'
device = 'cuda'

model = AutoModelForCausalLM.from_pretrained(model_name_or_path).to(device)
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)

def quick_use():
      text = input('User: ').strip()
      inputs = tokenizer(text, return_tensors="pt").to(device)

      print('Opt: ', end='', flush=True)
      tokens = model.generate(
          **inputs,
          max_new_tokens=64,
          do_sample=True,
      )

      response = tokenizer.decode(tokens[0])
      print(response)

if __name__ == '__main__':
    quick_use()
Downloads last month
84
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Dataset used to train Sholder/chinese-opt-125m