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
ERNIE-Image_pytorch
Commits
d1d45737
Commit
d1d45737
authored
Apr 14, 2026
by
raojy
💬
Browse files
Update run.py
parent
380f7a99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
run.py
run.py
+2
-2
No files found.
run.py
View file @
d1d45737
...
@@ -22,7 +22,7 @@ torch.backends.cudnn.benchmark = False
...
@@ -22,7 +22,7 @@ torch.backends.cudnn.benchmark = False
# 加载 pipeline
# 加载 pipeline
# 注意:如果你的 DCU 版本(如某些较老的型号)对 bfloat16 支持不佳,可以尝试换成 torch.float16
# 注意:如果你的 DCU 版本(如某些较老的型号)对 bfloat16 支持不佳,可以尝试换成 torch.float16
pipe
=
ErnieImagePipeline
.
from_pretrained
(
pipe
=
ErnieImagePipeline
.
from_pretrained
(
"
/public/home/raojy/project/
baidu/ERNIE-Image"
,
"baidu/ERNIE-Image"
,
torch_dtype
=
torch
.
bfloat16
torch_dtype
=
torch
.
bfloat16
)
)
...
@@ -62,4 +62,4 @@ for idx, prompt in enumerate(prompt_list):
...
@@ -62,4 +62,4 @@ for idx, prompt in enumerate(prompt_list):
revised_prompt
=
output
.
revised_prompts
revised_prompt
=
output
.
revised_prompts
images
=
output
.
images
images
=
output
.
images
images
[
0
].
save
(
f
"../tests/hf_output
{
idx
+
1
}
.png"
)
images
[
0
].
save
(
f
"../tests/hf_output
{
idx
+
1
}
.png"
)
print
(
f
"Prompt
{
idx
+
1
}
revised:
{
revised_prompt
}
"
)
print
(
f
"Prompt
{
idx
+
1
}
revised:
{
revised_prompt
}
"
)
\ No newline at end of file
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