BMInf (Big Model Inference) is a low-resource inference package for large-scale pretrained language models (PLMs).

Overview

BMInf

DocumentationFeaturesInstallationQuick StartSupported Models简体中文

BMInf (Big Model Inference) is a low-resource inference package for large-scale pretrained language models (PLMs). It has following features:

  • Hardware Friendly. BMInf supports running models with more than 10 billion parameters on a single NVIDIA GTX 1060 GPU in its minimum requirements. Running with better GPUs leads to better performance. In cases where the GPU memory supports the large model inference (such as V100 or A100), BMInf still has a significant performance improvement over the existing PyTorch implementation.
  • Open. The parameters of models are open. Users can access large models locally with their own machines without applying or accessing an online API.
  • Comprehensive Ability. BMInf supports generative model CPM1 [1], general language model CPM2.1 [2], and dialogue model EVA [3]. The abilities of these models cover text completion, text generation, and dialogue generation.
  • Upgraded Model. Based on CPM2 [2], the newly upgraded model CPM2.1 is currently supported. Based on continual learning, the text generation ability of CPM2.1 is greatly improved compared to CPM2.
  • Convenient Deployment. Using BMInf, it will be fast and convenient to develop interesting downstream applications.

Demo

demo

Documentation

Our documentation provides more information about the package.

Install

  • From pip: pip install bminf

  • From source code: download the package and run python setup.py install

  • From docker: docker run -it --gpus 1 -v $HOME/.cache/bigmodels:/root/.cache/bigmodels --rm openbmb/bminf python3 examples/fill_blank.py

Here we list the minimum and recommended configurations for running BMInf.

Minimum Configuration Recommended Configuration
Memory 16GB 24GB
GPU NVIDIA GeForce GTX 1060 6GB NVIDIA Tesla V100 16GB
PCI-E PCI-E 3.0 x16 PCI-E 3.0 x16

Quick Start

Here we provide a simple script for using BMInf.

Firstly, import a model from the model base (e.g. CPM1, CPM2, EVA).

import bminf
cpm2 = bminf.models.CPM2()

Then define the text and use the token to denote the blank to fill in.

制度,即推出淡季日、平季日、旺季日和特定日门票。价格为418元,价格为528元,价格为638元,价格为元。北京环球度假区将提供90天滚动价格日历,以方便游客提前规划行程。" ">
text = "北京环球度假区相关负责人介绍,北京环球影城指定单日门票将采用制度,即推出淡季日、平季日、旺季日和特定日门票。价格为418元,价格为528元,价格为638元,价格为元。北京环球度假区将提供90天滚动价格日历,以方便游客提前规划行程。"

Use the fill_blank function to obtain the results and replace tokens with the results.

", "\033[0;32m" + value + "\033[0m", 1) print(text) ">
for result in cpm2.fill_blank(text, 
    top_p=1.0,
    top_n=10, 
    temperature=0.9,
    frequency_penalty=0,
    presence_penalty=0
):
    value = result["text"]
    text = text.replace("", "\033[0;32m" + value + "\033[0m", 1)
print(text)

Finally, you can get the predicted text. For more examples, go to the examples folder.

Supported Models

BMInf currently supports these models:

  • CPM2.1. CPM2.1 is an upgraded version of CPM2 [1], which is a general Chinese pre-trained language model with 11 billion parameters. Based on CPM2, CPM2.1 introduces a generative pre-training task and was trained via the continual learning paradigm. In experiments, CPM2.1 has a better generation ability than CPM2.

  • CPM1. CPM1 [2] is a generative Chinese pre-trained language model with 2.6 billion parameters. The architecture of CPM1 is similar to GPT [4] and it can be used in various NLP tasks such as conversation, essay generation, cloze test, and language understanding.

  • EVA. EVA [3] is a Chinese pre-trained dialogue model with 2.8 billion parameters. EVA performs well on many dialogue tasks, especially in the multi-turn interaction of human-bot conversations.

Besides these models, we are now working on adding more PLMs especially large-scale PLMs. We welcome every contributor to add their models to this project by proposing an issue.

Performances

Here we report the speeds of CPM2 encoder and decoder we have tested on different platforms. You can also run benchmark/cpm2/encoder.py and benchmark/cpm2/decoder.py to test the speed on your machine!

Implementation GPU Encoder Speed (tokens/s) Decoder Speed (tokens/s)
BMInf NVIDIA GeForce GTX 1060 533 1.6
BMInf NVIDIA GeForce GTX 1080Ti 1200 12
BMInf NVIDIA GeForce GTX 2080Ti 2275 19
BMInf NVIDIA Tesla V100 2966 20
BMInf NVIDIA Tesla A100 4365 26
PyTorch NVIDIA Tesla V100 - 3
PyTorch NVIDIA Tesla A100 - 7

Contributing

Here is the QRCode to our WeChat user community and we welcome others to contribute codes following our contributing guidelines.

Our community

License

The package is released under the Apache 2.0 License.

References

  1. CPM-2: Large-scale Cost-efficient Pre-trained Language Models. Zhengyan Zhang, Yuxian Gu, Xu Han, Shengqi Chen, Chaojun Xiao, Zhenbo Sun, Yuan Yao, Fanchao Qi, Jian Guan, Pei Ke, Yanzheng Cai, Guoyang Zeng, Zhixing Tan, Zhiyuan Liu, Minlie Huang, Wentao Han, Yang Liu, Xiaoyan Zhu, Maosong Sun.
  2. CPM: A Large-scale Generative Chinese Pre-trained Language Model. Zhengyan Zhang, Xu Han, Hao Zhou, Pei Ke, Yuxian Gu, Deming Ye, Yujia Qin, Yusheng Su, Haozhe Ji, Jian Guan, Fanchao Qi, Xiaozhi Wang, Yanan Zheng, Guoyang Zeng, Huanqi Cao, Shengqi Chen, Daixuan Li, Zhenbo Sun, Zhiyuan Liu, Minlie Huang, Wentao Han, Jie Tang, Juanzi Li, Xiaoyan Zhu, Maosong Sun.
  3. EVA: An Open-Domain Chinese Dialogue System with Large-Scale Generative Pre-Training. Hao Zhou, Pei Ke, Zheng Zhang, Yuxian Gu, Yinhe Zheng, Chujie Zheng, Yida Wang, Chen Henry Wu, Hao Sun, Xiaocong Yang, Bosi Wen, Xiaoyan Zhu, Minlie Huang, Jie Tang.
  4. Language Models are Unsupervised Multitask Learners. Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever.
Comments
  • CPM2.1模型做文本生成时的问题

    CPM2.1模型做文本生成时的问题

    我在尝试用CPM2.1进行文本生成时,为了生成更长的结果,我修改了下面这行代码,使程序不会在生成标点符号时就停止。 https://github.com/OpenBMB/BMInf/blob/59e8903366ed53615d8af0a61e15b9f932042dcc/bminf/models/cpm2.py#L216

    我的调用方法如下: image

    在修改代码后,我发现生成的结果result中会有换行符(由词表中id为3的token转换而来),并且在换行后,上下文就不再连贯了,像是另起了一个段,有时候甚至话题都变了,如下图。

    这个例子在开始生成时直接换行了。 image

    这个例子在换行后话题出现了较大变化。 image

    1. 这种现象的出现是因为训练时就是以这种方式分隔段落的吗?
    2. 可否允许从generate函数传入自定义的”停止字符“来控制生成行为?
    3. 可否给出一个CPM2.1用来生成长篇文本的示例?
    enhancement question solved 
    opened by huhk-sysu 10
  • RuntimeError: CUBLAS error: CUBLAS_STATUS_EXECUTION_FAILED[BUG]

    RuntimeError: CUBLAS error: CUBLAS_STATUS_EXECUTION_FAILED[BUG]

    Describe the bug

    用的CPM-2提供的docker镜像,出现该bug,其他环境没有尝试。

    Minimal steps to reproduce

    Expected behavior

    运行examples下面的generate以及quick start中的代码都报错

    Screenshots

    image

    Environment:

    image image

    bug 
    opened by zhangxliang 5
  • [BUG] eva2 = bminf.models.EVA2()

    [BUG] eva2 = bminf.models.EVA2()

    EVA报错

    In [11]: eva2 = bminf.models.EVA2()

    KeyError Traceback (most recent call last) in () ----> 1 eva2 = bminf.models.EVA2()

    ~/anaconda3/envs/yhs/lib/python3.6/site-packages/bminf/models/eva2.py in init(self, device, memory_limit, config) 56 raise ValueError("Memory is not enough") 57 ---> 58 super().init(config) 59 60 def dialogue(self,

    ~/anaconda3/envs/yhs/lib/python3.6/site-packages/bminf/arch/t5/model.py in init(self, config) 73 vocab_path = data.ensure_file(config.MODEL_NAME, "vocab.txt") 74 ---> 75 self.tokenizer = T5Tokenizer(vocab_path) 76 77 self.device = config.DEVICE

    ~/anaconda3/envs/yhs/lib/python3.6/site-packages/bminf/arch/t5/tokenizer.py in init(self, vocab_path, max_len, max_sentinels) 81 self.translator_dec = str.maketrans("\u2582\u2583", " \n") 82 ---> 83 self.sentinel_list = [self.encoder['<s_{}>'.format(i)] for i in range(max_sentinels)] 84 85 @property

    ~/anaconda3/envs/yhs/lib/python3.6/site-packages/bminf/arch/t5/tokenizer.py in (.0) 81 self.translator_dec = str.maketrans("\u2582\u2583", " \n") 82 ---> 83 self.sentinel_list = [self.encoder['<s_{}>'.format(i)] for i in range(max_sentinels)] 84 85 @property

    KeyError: '<s_0>'

    bug solved 
    opened by Hansen06 5
  • RuntimeError: CUBLAS error: CUBLAS_STATUS_NOT_INITIALIZED [BUG]

    RuntimeError: CUBLAS error: CUBLAS_STATUS_NOT_INITIALIZED [BUG]

    running the example file fill_blank.py, it raise error as follows:

    Loading model
    Start
    Input:  北京环球度假区相关负责人介绍,北京环球影城指定单日门票将采用____制度,即推出淡季日、平季日、旺季日和特定日门票。____价格为418元,____价格为528元,____价格为638元,____价格为____元。北京环球度假区将提供90天滚动价格日历,以方便游客提前规划行程。
    Traceback (most recent call last):
      File "abc.py", line 28, in <module>
        main()
      File "abc.py", line 25, in main
        fill_blank(cpm2, input_text)
      File "abc.py", line 9, in fill_blank
        for result in cpm2.fill_blank(text,
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/bminf/models/cpm2.py", line 245, in fill_blank
        for token in res:
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/bminf/models/cpm2.py", line 129, in _gen_iter
        self._model.embedding(
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/bminf/arch/t5/model.py", line 165, in embedding
        self.input_embedding.embedding_forward(ctx, tensor_ids, x_out)
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/bminf/layers/embedding.py", line 27, in embedding_forward
        ck.embedding_forward(
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/cpm_kernels/kernels/embedding.py", line 25, in embedding_forward
        embedding_kernel.cu_embedding_forward(
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/cpm_kernels/kernels/base.py", line 48, in __call__
        func = self._prepare_func()
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/cpm_kernels/kernels/base.py", line 40, in _prepare_func
        self._module.get_module(), self._func_name
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/cpm_kernels/kernels/base.py", line 23, in get_module
        Device(curr_device).use()   # force initialize context
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/cpm_kernels/device/__init__.py", line 152, in use
        self._device.use()
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/cpm_kernels/device/__init__.py", line 120, in use
        self.cublasLtHandle = cublaslt.cublasLtCreate()
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/cpm_kernels/library/base.py", line 94, in wrapper
        return f(*args, **kwargs)
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/cpm_kernels/library/cublaslt.py", line 105, in cublasLtCreate
        checkCublasStatus(cublasLt.cublasLtCreate(ctypes.byref(handle)))
      File "/home/hmqf/miniconda3/envs/script_bert/lib/python3.8/site-packages/cpm_kernels/library/cublaslt.py", line 98, in checkCublasStatus
        raise RuntimeError("CUBLAS error: {}".format(
    RuntimeError: CUBLAS error: CUBLAS_STATUS_NOT_INITIALIZED
    

    Environment: Python 3.8.10 cudatoolkit 11.3.1

    opened by fangd123 4
  • 是否支持cpm2 finetune repo的模型

    是否支持cpm2 finetune repo的模型

    请问该工具是否直接支持 cpm2-finetune配套的cpm2模型(需要到智源页面申请); 我下载了中英文模型,100亿参数,vocab大小51967;本来有4个单独的文件,我按照官方脚本将其合并成1个单文件模型,测试显示没问题; 修改一些参数后,用bminf 下的 example/generate_cpm2.py加载我合并的单文件模型进行测试,无法加载,错误如下: image

    更新1

    1. 我发现应该是要加载压缩量化等技术处理之后的模型,tool下有个migrate_cpm2.py,我用它做了量化工作,得到11g的模型;建议可以把文档写的详细一点。

    2. 用 migrate_cpm2.py量化后,重新微调是如何做的,类似 训练过程量化(quantized-aware)吗? image

    3. 我用generate_cpm2.py加载上面 量化后的11g模型,推理时设置最多生成100个字,查看显存占用要用13g+(A100),不知道要怎么做到你们 doc 说的 显存调度,可以在2080ti下跑推理(2080ti只有11g显存)?

    4. 请问怎么样把模型的模块拆分到不同gpu?这样可以解决第3步11g显存不够用的问题。比如把encoder、decoder分配到不同的gpu。我看模型构建并不是用torch等框架,数据迁移到显存主要靠with device 和 allocator好像,所以没太懂怎么把不同模块分配到不同gpu;

    @a710128 期望回复,谢谢

    question 
    opened by 2020zyc 4
  • cublas error: CUBLAS_STATUS_NOT_SUPPORTED

    cublas error: CUBLAS_STATUS_NOT_SUPPORTED

    运行examples/generate.py时报错,上层调用栈是functions/gemm.py的第249行。 https://github.com/OpenBMB/BMInf/blob/d40c6f5d5678e1cba771048ecd0923bceae176e2/bminf/functions/gemm.py#L249

    使用的环境为: cuda 10.1(cublas版本为10.1.0.63) BMInf 0.0.4 通过clone + python setup.py install方式安装 torch 1.7.1

    bug solved 
    opened by huhk-sysu 4
  • fill_blank报错,换成别的文本进行填空提示Unexpected model output: 26239

    fill_blank报错,换成别的文本进行填空提示Unexpected model output: 26239

    将输入改成 input_text = "近日,北京智源人工智能研究院和清华大学研究团队发布了以中文为核心的大规模预训练语言模型 CPM-LM,参数规模达 26 亿,预训练中文数据规模 100 GB。" 会报错 "Unexpected model output: 26239" 请问fill_blank输入的文本有什么要求?或者对要填空的词有什么要求? 用的是 cpm2 = bminf.models.CPM2()

    用pip 安装的,bminf-1.0.0

    question 
    opened by bidoudhd 3
  • [BUG]运行generate_cpm2.py 报value error

    [BUG]运行generate_cpm2.py 报value error

    运行generate_cpm2.py 报value error

    (EVAAA) [root@localhost examples]# python generate_cpm2.py Loading model Input: 天空是蔚蓝色,窗外有 Output: 天空是蔚蓝色,窗外有Traceback (most recent call last): File "generate_cpm2.py", line 32, in main() File "generate_cpm2.py", line 29, in main generate(cpm2_1, input_text) File "generate_cpm2.py", line 11, in generate value, stoped = model.generate( ValueError: too many values to unpack (expected 2)

    bug solved 
    opened by xiaoqiao 3
  • running examples and get error:  type object 'cublasLt' has no attribute 'cublasLtHandle_t'

    running examples and get error: type object 'cublasLt' has no attribute 'cublasLtHandle_t'

    when running examples/fill_blank.py, get error: AttributeError: type object 'cublasLt' has no attribute 'cublasLtHandle_t'

    cuda version is 10.0 have successfully installed bminf 0.4.0 any idea how to solve this problem?

    documentation question solved 
    opened by qiufengyuyi 3
  • [FEATURE]How to finetune CPM2.1?

    [FEATURE]How to finetune CPM2.1?

    I am not familiar with int8. But i suppose it can not be trained like other fp32 models? Any suggestion about how to finetune it?

    And does cpm2.1 has any report or paper? I did not find it anywhere.

    Thank you!

    opened by drxmy 2
  • [FEATURE]允许加载本地模型

    [FEATURE]允许加载本地模型

    Is your feature request related to a problem? Please describe.

    有时候跑模型的服务器是物理断网的,需要手动下载模型上传后再加载。 从前(0.0.4版本)可以通过设置config的MODEL_NAME实现本地加载,但代码更新到1.0.0以后不能这样做了(除非修改BMInf的源码)。

    Describe the solution you'd like

    在初始化模型时提供一个接口,指定本地路径进行加载(可能通过修改现有的version字段实现)。

    Describe alternatives you've considered

    无。

    其他:请问0.0.4到1.0.0之间,CPM2.1模型是否更新过?使用1.0.0的代码加载0.0.4时期下载的模型时报错了。

    opened by huhk-sysu 2
  • [BUG]请问BMInf支持transformers的模型吗?我用BMInf包装模型推理时报错了

    [BUG]请问BMInf支持transformers的模型吗?我用BMInf包装模型推理时报错了

    模型代码:

    self.model = MyBert.from_pretrained(pretrained_model_name_or_path=model_path,)
    self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
    self.model.to(self.device)
    self.model = bminf.wrapper(self.model)
    

    错误信息:

    input_embed = self.model.bert(**input_tokenized)["last_hidden_state"]
      File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl
        return forward_call(*input, **kwargs)
      File "/usr/local/lib/python3.8/dist-packages/transformers/models/bert/modeling_bert.py", line 1022, in forward
        encoder_outputs = self.encoder(
      File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl
        return forward_call(*input, **kwargs)
      File "/usr/local/lib/python3.8/dist-packages/transformers/models/bert/modeling_bert.py", line 611, in forward
        layer_outputs = layer_module(
      File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl
        return forward_call(*input, **kwargs)
      File "/usr/local/lib/python3.8/dist-packages/transformers/models/bert/modeling_bert.py", line 497, in forward
        self_attention_outputs = self.attention(
      File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl
        return forward_call(*input, **kwargs)
      File "/usr/local/lib/python3.8/dist-packages/transformers/models/bert/modeling_bert.py", line 427, in forward
        self_outputs = self.self(
      File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl
        return forward_call(*input, **kwargs)
      File "/usr/local/lib/python3.8/dist-packages/transformers/models/bert/modeling_bert.py", line 293, in forward
        mixed_query_layer = self.query(hidden_states)
      File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl
        return forward_call(*input, **kwargs)
      File "/usr/local/lib/python3.8/dist-packages/bminf/quantization/__init__.py", line 81, in forward
        out = OpLinear.apply(x, self.weight_quant, self.weight_scale)
      File "/usr/local/lib/python3.8/dist-packages/bminf/quantization/__init__.py", line 31, in forward
        gemm_int8(
      File "/usr/local/lib/python3.8/dist-packages/cpm_kernels/kernels/gemm.py", line 139, in gemm_int8
        assert m % 4 == 0 and n % 4 == 0 and k % 4 == 0
    AssertionError
    
    opened by L-hongbin 1
  • [BUG]RuntimeError: cublas error: CUBLAS_STATUS_NOT_SUPPORTED

    [BUG]RuntimeError: cublas error: CUBLAS_STATUS_NOT_SUPPORTED

    Describe the bug 使用docker环境,运行三个demo时后台都报错误 File "/usr/local/lib/python3.6/dist-packages/bminf/arch/t5/model.py", line 238, in encode True File "/usr/local/lib/python3.6/dist-packages/bminf/layers/transformer_block.py", line 42, in forward x = self.self_attention.forward(allocator, x, attention_mask, self_attn_position_bias) File "/usr/local/lib/python3.6/dist-packages/bminf/layers/attention.py", line 63, in forward qkv_i32 File "/usr/local/lib/python3.6/dist-packages/bminf/functions/gemm.py", line 86, in igemm _igemm(allocator, a, aT, b, bT, c, device, stream) File "/usr/local/lib/python3.6/dist-packages/bminf/functions/gemm.py", line 265, in _igemm stream.ptr File "/usr/local/lib/python3.6/dist-packages/bminf/backend/cublaslt.py", line 101, in checkCublasStatus raise RuntimeError("cublas error: %s" % cublas_errors[cublas_status]) RuntimeError: cublas error: CUBLAS_STATUS_NOT_SUPPORTED

    请问是什么原因,是哪个版本有问题吗?

    Environment: cuda:10.1 模型:EVA-int8 显存:12G

    opened by cuishibin 0
  • 请教CUPY/CUDA

    请教CUPY/CUDA

    1. 您好,如图所述,我想查看 cupy操作cuda的函数的具体定义和用法,但是可能是因为cupy封装了c/c++代码,所以看不到,请问可以去哪里看呢? 能帮忙解释一下图中第3个参数 routine 里面 4个函数执行顺序吗(我了解大概是 创建结构体、计算对称量化的scale)
    image

    跳到定义处,就只有这样的doc image


    1. 请问下图红框内为什么那样写?
    image

    3. 想问一下为什么选择使用cupy直接操作cuda呢,比如allocator、igemm、fgemm的应用?这样相比使用框架(如pytorch等)实现量化有更大的好处吗?感觉cupy+cuda实现方式 要求挺高的

    非常感谢

    @a710128

    opened by 2020zyc 1
  • [BUG]RuntimeError: Library cublasLt is not initialized

    [BUG]RuntimeError: Library cublasLt is not initialized

    Describe the bug

    运行路径https://github.com/OpenBMB/BMInf 的demo时候,出现RuntimeError: Library cublasLt is not initialized错误

    Minimal steps to reproduce

    import bminf #成功导入 cpm2 = bminf.models.CPM2() #成功定义 cpm2.fill_blank('好') #报错 RuntimeError: Library cublasLt is not initialized Expected behavior

    Screenshots

    image image

    Environment:

    NVIDIA-SMI 465.19.01 Driver Version: 465.19.01 NVIDIA A40
    CUDA Version: 11.3 Memory:45634MiB

    opened by hxl523 0
  • [BUG] RuntimeError: Unexpected model output: 26239

    [BUG] RuntimeError: Unexpected model output: 26239

    Describe the bug

    输入: import bminf cpm2 = bminf.models.CPM2() result = cpm2.fill_blank("有一个服装品牌叫做<span>专门设计彩绘T恤", top_p=0.5, top_n=5, temperature=0.5, frequency_penalty=0, presence_penalty=0 )

    报错信息: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py", line 3331, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 6, in presence_penalty=0 File "/usr/local/lib/python3.6/dist-packages/bminf/models/cpm2.py", line 252, in fill_blank raise RuntimeError("Unexpected model output: %d" % token) RuntimeError: Unexpected model output: 26239

    请帮忙看看是什么原因

    Environment: python3.6 torch1.8.1

    opened by mali19064 0
Releases(2.0.0)
Owner
OpenBMB
Open Lab for Big Model Base
OpenBMB
Prompt-learning is the latest paradigm to adapt pre-trained language models (PLMs) to downstream NLP tasks

Prompt-learning is the latest paradigm to adapt pre-trained language models (PLMs) to downstream NLP tasks, which modifies the input text with a textual template and directly uses PLMs to conduct pre-trained tasks. This library provides a standard, flexible and extensible framework to deploy the prompt-learning pipeline. OpenPrompt supports loading PLMs directly from huggingface transformers. In the future, we will also support PLMs implemented by other libraries.

THUNLP 2.3k Jan 8, 2023
IndoBERTweet is the first large-scale pretrained model for Indonesian Twitter. Published at EMNLP 2021 (main conference)

IndoBERTweet ?? ???? 1. Paper Fajri Koto, Jey Han Lau, and Timothy Baldwin. IndoBERTweet: A Pretrained Language Model for Indonesian Twitter with Effe

IndoLEM 40 Nov 30, 2022
CPC-big and k-means clustering for zero-resource speech processing

The CPC-big model and k-means checkpoints used in Analyzing Speaker Information in Self-Supervised Models to Improve Zero-Resource Speech Processing.

Benjamin van Niekerk 5 Nov 23, 2022
Code for text augmentation method leveraging large-scale language models

HyperMix Code for our paper GPT3Mix and conducting classification experiments using GPT-3 prompt-based data augmentation. Getting Started Installing P

NAVER AI 47 Dec 20, 2022
Tools for curating biomedical training data for large-scale language modeling

Tools for curating biomedical training data for large-scale language modeling

BigScience Workshop 242 Dec 25, 2022
This repository contains the code for "Generating Datasets with Pretrained Language Models".

Datasets from Instructions (DINO ?? ) This repository contains the code for Generating Datasets with Pretrained Language Models. The paper introduces

Timo Schick 154 Jan 1, 2023
ProteinBERT is a universal protein language model pretrained on ~106M proteins from the UniRef90 dataset.

ProteinBERT is a universal protein language model pretrained on ~106M proteins from the UniRef90 dataset. Through its Python API, the pretrained model can be fine-tuned on any protein-related task in a matter of minutes. Based on our experiments with a wide range of benchmarks, ProteinBERT usually achieves state-of-the-art performance. ProteinBERT is built on TenforFlow/Keras.

null 241 Jan 4, 2023
null 189 Jan 2, 2023
PyTorch implementation and pretrained models for XCiT models. See XCiT: Cross-Covariance Image Transformer

Cross-Covariance Image Transformer (XCiT) PyTorch implementation and pretrained models for XCiT models. See XCiT: Cross-Covariance Image Transformer L

Facebook Research 605 Jan 2, 2023
Guide to using pre-trained large language models of source code

Large Models of Source Code I occasionally train and publicly release large neural language models on programs, including PolyCoder. Here, I describe

Vincent Hellendoorn 947 Dec 28, 2022
Ongoing research training transformer language models at scale, including: BERT & GPT-2

What is this fork of Megatron-LM and Megatron-DeepSpeed This is a detached fork of https://github.com/microsoft/Megatron-DeepSpeed, which in itself is

BigScience Workshop 316 Jan 3, 2023
Ongoing research training transformer language models at scale, including: BERT & GPT-2

Megatron (1 and 2) is a large, powerful transformer developed by the Applied Deep Learning Research team at NVIDIA.

NVIDIA Corporation 3.5k Dec 30, 2022
Composed Image Retrieval using Pretrained LANguage Transformers (CIRPLANT)

CIRPLANT This repository contains the code and pre-trained models for Composed Image Retrieval using Pretrained LANguage Transformers (CIRPLANT) For d

Zheyuan (David) Liu 29 Nov 17, 2022
CCKS-Title-based-large-scale-commodity-entity-retrieval-top1

- 基于标题的大规模商品实体检索top1 一、任务介绍 CCKS 2020:基于标题的大规模商品实体检索,任务为对于给定的一个商品标题,参赛系统需要匹配到该标题在给定商品库中的对应商品实体。 输入:输入文件包括若干行商品标题。 输出:输出文本每一行包括此标题对应的商品实体,即给定知识库中商品 ID,

null 43 Nov 11, 2022
Learning General Purpose Distributed Sentence Representations via Large Scale Multi-task Learning

GenSen Learning General Purpose Distributed Sentence Representations via Large Scale Multi-task Learning Sandeep Subramanian, Adam Trischler, Yoshua B

Maluuba Inc. 309 Oct 19, 2022
Large-scale Knowledge Graph Construction with Prompting

Large-scale Knowledge Graph Construction with Prompting across tasks (predictive and generative), and modalities (language, image, vision + language, etc.)

ZJUNLP 161 Dec 28, 2022
Simplified diarization pipeline using some pretrained models - audio file to diarized segments in a few lines of code

simple_diarizer Simplified diarization pipeline using some pretrained models. Made to be a simple as possible to go from an input audio file to diariz

Chau 65 Dec 30, 2022
A library for finding knowledge neurons in pretrained transformer models.

knowledge-neurons An open source repository replicating the 2021 paper Knowledge Neurons in Pretrained Transformers by Dai et al., and extending the t

EleutherAI 96 Dec 21, 2022