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

Inference fine-tuning support for internlm-xcomposer2d5-ol-7b #450

Open
Jintao-Huang opened this issue Dec 14, 2024 · 3 comments
Open

Inference fine-tuning support for internlm-xcomposer2d5-ol-7b #450

Jintao-Huang opened this issue Dec 14, 2024 · 3 comments
Assignees

Comments

@Jintao-Huang
Copy link

No description provided.

@Jintao-Huang
Copy link
Author

Due to interface changes in Swift 3.0, in order to avoid breaking changes affecting the example code for internlm-xcomposer2d5-ol-7b, Swift 3.0 will quickly provide support for internlm-xcomposer2d5-ol-7b.

@Jintao-Huang
Copy link
Author

❤️

@Jintao-Huang
Copy link
Author

# pip install git+https://github.com/modelscope/ms-swift.git
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'

from swift.llm import PtEngine, InferRequest, RequestConfig
import torch
engine = PtEngine('Shanghai_AI_Laboratory/internlm-xcomposer2d5-ol-7b:audio', torch_dtype=torch.float16)
request_config = RequestConfig(max_tokens=512)
resp_list = engine.infer([InferRequest(messages=[{'role': 'user', 'content': '<audio>Detect the language and recognize the speech.'}],
                                       audios=['https://modelscope-open.oss-cn-hangzhou.aliyuncs.com/images/chinese.mp3'])])
print(f'response: {resp_list[0].choices[0].message.content}')

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

No branches or pull requests

2 participants