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

support Shanghai_AI_Laboratory/internlm-xcomposer2d5-ol-7b:audio #2658

Merged

Conversation

Jintao-Huang
Copy link
Collaborator

@Jintao-Huang
Copy link
Collaborator Author

model: https://modelscope.cn/models/Shanghai_AI_Laboratory/internlm-xcomposer2d5-ol-7b

inference code:

# 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}')

@Jintao-Huang Jintao-Huang merged commit 3c6274f into modelscope:main Dec 14, 2024
2 checks passed
tastelikefeet added a commit to tastelikefeet/swift that referenced this pull request Dec 16, 2024
* commit '5bfd0c49c6a7180c442bfdc15287220ecb2b68f1':
  fix dataset (modelscope#2670)
  fix unsloth resume training (modelscope#2668)
  support megrez (modelscope#2667)
  fix liger (modelscope#2666)
  fix hub (modelscope#2661)
  support Shanghai_AI_Laboratory/internlm-xcomposer2d5-ol-7b:base (modelscope#2660)
  support Shanghai_AI_Laboratory/internlm-xcomposer2d5-ol-7b:audio (modelscope#2658)
  fix swift/SlimOrca (modelscope#2657)
  fix swift/SlimOrca (modelscope#2656)
  support deepseek_vl2 (modelscope#2654)
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