HuggingFace镜像/t5-efficient-gc4-german-base-nl36
模型介绍文件和版本分析
下载使用量0

在 openmind 中的使用

from openmind import pipeline, is_torch_npu_available

model = "huangjingwang/t5-efficient-gc4-german-base-nl36"

if is_torch_npu_available():
    print("NPU available, use device_map='auto'.")
    device_map = "auto"
else:
    print("NPU not available, use device_map='cpu'.")
    device_map = "cpu"
pipe = pipeline("text2text-generation", model=model, device_map=device_map)


input_text = """Classify the text into neutral, negative or positive. 
Text: This movie is definitely one of my favorite movies of its kind. The interaction between respectable and morally strong characters is an ode to chivalry and the honor code amongst thieves and policemen.
Sentiment:
"""

output = pipe(input_text, max_length=100, truncation=True)
print(output[0])

# ["If you bought something gorgeous, you will be very happy."]

创建者

  • Stefan Schweter(schweter.ml)
  • Philip May(德国电信)
  • Philipp Schmid(Hugging Face)

评估

评估在一项摘要任务上进行,具体信息如下:

  • 训练数据:Swisstext
  • 测试数据:MLSUM
  • 图形处理器(GPU):4 块(V100)

详细信息请参见:https://github.com/GermanT5/german-t5-eval

GPU 训练提示

在 FP32 模式下,该模型过大,无法在普通的 16GB GPU 上运行。 由于多种原因,T5 模型不能在 FP16 模式下进行训练。 然而,许多 GPU 尚不支持混合精度训练。例如,在 V100 GPU 上无法使用,但在 A100 上可以。

因此,我们建议使用 DeepSpeed 进行训练。 特别推荐采用 ZeRO-3 示例 中的 auto 配置。

ZeRO-Offload 通过利用 GPU 及其宿主 CPU 上的计算和内存资源,突破了使用最少 GPU 资源高效训练最大模型规模的限制。

详见 ZeRO-Offload

许可证 - MIT 许可证

版权所有 2022 Stefan Schweter
版权所有 2022 Philip May
版权所有 2022 Philipp Schmid

特此授予任何获得本软件及相关文档文件(以下简称“软件”)副本的人免费许可,使其不受限制地处理本软件,包括但不限于使用、复制、修改、合并、出版、分发、再许可和/或销售软件副本的权利,并允许向其提供软件的人做出上述行为,但须遵守以下条件:

上述版权声明和本许可声明应包含在软件的所有副本或主要部分中。

本软件按“原样”提供,不提供任何明示或暗示的担保,包括但不限于对适销性、特定用途适用性和非侵权性的担保。在任何情况下,作者或版权持有人均不对任何索赔、损害或其他责任承担责任,无论是在合同诉讼、侵权诉讼还是其他诉讼中,这些索赔、损害或责任源于、与软件或软件的使用或其他交易有关。