Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telechat2模型注册,完成MindIE服务化部署 #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BruceFeiFei
Copy link

相关的Issue

【910B】【Telechat2-7B】【MindIE-Service封装】Import模型报错,无法识别TelechatForCausalLM
报错log:import MindIEModelRunner from module TelechatForCausalLM failed

Reason(目的、解决的问题等)

无法导入模型,telechat2模型未完成注册

Description

完成telechat2模型注册
Step1:在mindformers/models下创建telechat2文件夹,完成api注册,模型目录结构如下:
telechat2
├── init.py
├── telechat.py # 模型实现
├── telechat_config.py # 模型配置项
└── tokenization_telechat2.py # tokenizer
Step2:其中/mindformers/models/telechat2/init.py import导入相应对外接口,保证装饰器注册方式被执行

from .telechat import TelechatForCausalLM
from .tokenization_telechat2 import Telechat2Tokenizer
from .telechat_config import TelechatConfig

__all__ = ['TelechatForCausalLM', 'Telechat2Tokenizer', 'TelechatConfig']

Step3:mindformers/models/init.py import telechat2包下所有对外开放的API,以保证所有模块被自动执行注册

from .telechat2 import (
    TelechatForCausalLM,
    Telechat2Tokenizer,
    TelechatConfig
)        
__all__.extend(telechat2.__all__)

启动mindIE服务成功截图:
image3
调用api截图:
image2

@BruceFeiFei BruceFeiFei marked this pull request as draft December 16, 2024 04:09
@BruceFeiFei BruceFeiFei marked this pull request as ready for review December 16, 2024 04:09
@BruceFeiFei BruceFeiFei marked this pull request as draft December 16, 2024 04:09
@BruceFeiFei BruceFeiFei marked this pull request as ready for review December 16, 2024 04:10
@BruceFeiFei BruceFeiFei marked this pull request as draft January 16, 2025 03:20
@BruceFeiFei BruceFeiFei marked this pull request as ready for review January 16, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant