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
Baichuan-M3_pytorch
Commits
b68561a0
Commit
b68561a0
authored
Mar 12, 2026
by
shihm
Browse files
add inference.py
parent
f2b3a0bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
inference.py
inference.py
+1
-1
No files found.
inference.py
View file @
b68561a0
...
@@ -10,7 +10,7 @@ model = AutoModelForCausalLM.from_pretrained(
...
@@ -10,7 +10,7 @@ model = AutoModelForCausalLM.from_pretrained(
device_map
=
"auto"
,
device_map
=
"auto"
,
dtype
=
torch
.
bfloat16
dtype
=
torch
.
bfloat16
)
)
enizer
=
AutoTokenizer
.
from_pretrained
(
model_path
,
trust_remote_code
=
True
)
tok
enizer
=
AutoTokenizer
.
from_pretrained
(
model_path
,
trust_remote_code
=
True
)
messages
=
[{
"role"
:
"user"
,
"content"
:
"I've been having headaches lately, especially worse in the afternoon. What should I do?"
}]
messages
=
[{
"role"
:
"user"
,
"content"
:
"I've been having headaches lately, especially worse in the afternoon. What should I do?"
}]
text
=
tokenizer
.
apply_chat_template
(
text
=
tokenizer
.
apply_chat_template
(
messages
,
messages
,
...
...
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