Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
MiniCPM-o-2.6_pytorch
Commits
548bd648
Commit
548bd648
authored
Apr 14, 2025
by
wanglch
Browse files
Update minicpm-o_audio.py
parent
8d99076d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
minicpm-o_audio.py
minicpm-o_audio.py
+2
-2
No files found.
minicpm-o_audio.py
View file @
548bd648
...
...
@@ -13,7 +13,7 @@ from modelscope import AutoModel, AutoTokenizer
# if load vision-only model, please set init_audio=False and init_tts=False
# if load audio-only model, please set init_vision=False
model
=
AutoModel
.
from_pretrained
(
'
MiniCPM-V
/MiniCPM-o-2_6'
,
'
openbmb
/MiniCPM-o-2_6'
,
trust_remote_code
=
True
,
attn_implementation
=
'sdpa'
,
# sdpa or flash_attention_2
torch_dtype
=
torch
.
bfloat16
,
...
...
@@ -24,7 +24,7 @@ model = AutoModel.from_pretrained(
model
=
model
.
eval
().
cuda
()
tokenizer
=
AutoTokenizer
.
from_pretrained
(
'
MiniCPM-V
/MiniCPM-o-2_6'
,
trust_remote_code
=
True
)
tokenizer
=
AutoTokenizer
.
from_pretrained
(
'
openbmb
/MiniCPM-o-2_6'
,
trust_remote_code
=
True
)
# In addition to vision-only mode, tts processor and vocos also needs to be initialized
model
.
init_tts
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment