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) [[email protected] 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
(ACL-IJCNLP 2021) Convolutions and Self-Attention: Re-interpreting Relative Positions in Pre-trained Language Models.

BERT Convolutions Code for the paper Convolutions and Self-Attention: Re-interpreting Relative Positions in Pre-trained Language Models. Contains expe

mlpc-ucsd 21 Jul 18, 2022
A Paper List for Speech Translation

Keyword: Speech Translation, Spoken Language Processing, Natural Language Processing

138 Dec 24, 2022
Text Analysis & Topic Extraction on Android App user reviews

AndroidApp_TextAnalysis Hi, there! This is code archive for Text Analysis and Topic Extraction from user_reviews of Android App. Dataset Source : http

Fitrie Ratnasari 1 Feb 14, 2022
Trained T5 and T5-large model for creating keywords from text

text to keywords Trained T5-base and T5-large model for creating keywords from text. Supported languages: ru Pretraining Large version | Pretraining B

Danil 61 Nov 24, 2022
Residual2Vec: Debiasing graph embedding using random graphs

Residual2Vec: Debiasing graph embedding using random graphs This repository contains the code for S. Kojaku, J. Yoon, I. Constantino, and Y.-Y. Ahn, R

SADAMORI KOJAKU 5 Oct 12, 2022
Yodatranslator is a simple translator English to Yoda-language

yodatranslator Overview yodatranslator is a simple translator English to Yoda-language. Project is created for educational purposes. It is intended to

1 Nov 11, 2021
Source code of paper "BP-Transformer: Modelling Long-Range Context via Binary Partitioning"

BP-Transformer This repo contains the code for our paper BP-Transformer: Modeling Long-Range Context via Binary Partition Zihao Ye, Qipeng Guo, Quan G

Zihao Ye 119 Nov 14, 2022
Natural Language Processing for Adverse Drug Reaction (ADR) Detection

Natural Language Processing for Adverse Drug Reaction (ADR) Detection This repo contains code from a project to identify ADRs in discharge summaries a

Medicines Optimisation Service - Austin Health 21 Aug 05, 2022
2021海华AI挑战赛·中文阅读理解·技术组·第三名

文字是人类用以记录和表达的最基本工具,也是信息传播的重要媒介。透过文字与符号,我们可以追寻人类文明的起源,可以传播知识与经验,读懂文字是认识与了解的第一步。对于人工智能而言,它的核心问题之一就是认知,而认知的核心则是语义理解。

21 Dec 26, 2022
Final Project Bootcamp Zero

The Quest (Pygame) Descripción Este es el repositorio de código The-Quest para el proyecto final Bootcamp Zero de KeepCoding. El juego consiste en la

Seven-z01 1 Mar 02, 2022
Unifying Cross-Lingual Semantic Role Labeling with Heterogeneous Linguistic Resources (NAACL-2021).

Unifying Cross-Lingual Semantic Role Labeling with Heterogeneous Linguistic Resources Description This is the repository for the paper Unifying Cross-

Sapienza NLP group 16 Sep 09, 2022
Pretrain CPM - 大规模预训练语言模型的预训练代码

CPM-Pretrain 版本更新记录 为了促进中文自然语言处理研究的发展,本项目提供了大规模预训练语言模型的预训练代码。项目主要基于DeepSpeed、Megatron实现,可以支持数据并行、模型加速、流水并行的代码。 安装 1、首先安装pytorch等基础依赖,再安装APEX以支持fp16。 p

Tsinghua AI 37 Dec 06, 2022
CCF BDCI BERT系统调优赛题baseline(Pytorch版本)

CCF BDCI BERT系统调优赛题baseline(Pytorch版本) 此版本基于Pytorch后端的huggingface进行实现。由于此实现使用了Oneflow的dataloader作为数据读入的方式,因此也需要安装Oneflow。其它框架的数据读取可以参考OneflowDataloade

Ziqi Zhou 9 Oct 13, 2022
Blue Brain text mining toolbox for semantic search and structured information extraction

Blue Brain Search Source Code DOI Data & Models DOI Documentation Latest Release Python Versions License Build Status Static Typing Code Style Securit

The Blue Brain Project 29 Dec 01, 2022
nlp-tutorial is a tutorial for who is studying NLP(Natural Language Processing) using Pytorch

nlp-tutorial is a tutorial for who is studying NLP(Natural Language Processing) using Pytorch. Most of the models in NLP were implemented with less than 100 lines of code.(except comments or blank li

Tae-Hwan Jung 11.9k Jan 08, 2023
Submit issues and feature requests for our API here.

AIx GPT API Submit issues and feature requests for our API here. See https://apps.aixsolutionsgroup.com for more info. Python Quick Start pip install

AIx Solutions 7 Mar 27, 2022
UniSpeech - Large Scale Self-Supervised Learning for Speech

UniSpeech The family of UniSpeech: WavLM (arXiv): WavLM: Large-Scale Self-Supervised Pre-training for Full Stack Speech Processing UniSpeech (ICML 202

Microsoft 281 Dec 15, 2022
Connectionist Temporal Classification (CTC) decoding algorithms: best path, beam search, lexicon search, prefix search, and token passing. Implemented in Python.

CTC Decoding Algorithms Update 2021: installable Python package Python implementation of some common Connectionist Temporal Classification (CTC) decod

Harald Scheidl 736 Jan 03, 2023
Trains an OpenNMT PyTorch model and SentencePiece tokenizer.

Trains an OpenNMT PyTorch model and SentencePiece tokenizer. Designed for use with Argos Translate and LibreTranslate.

Argos Open Tech 61 Dec 13, 2022
A Pytorch implementation of "Splitter: Learning Node Representations that Capture Multiple Social Contexts" (WWW 2019).

Splitter ⠀⠀ A PyTorch implementation of Splitter: Learning Node Representations that Capture Multiple Social Contexts (WWW 2019). Abstract Recent inte

Benedek Rozemberczki 201 Nov 09, 2022