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
GPT2_migraphx
Commits
9cffb74e
"vscode:/vscode.git/clone" did not exist on "dffb167449cf0e3ead73b4a67e84f222311b0ff5"
Commit
9cffb74e
authored
May 31, 2023
by
liucong
Browse files
修改python示例部分代码
parent
3b905a5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
Python/NLP/GPT2/gpt2.py
Python/NLP/GPT2/gpt2.py
+1
-1
No files found.
Python/NLP/GPT2/gpt2.py
View file @
9cffb74e
...
@@ -37,7 +37,7 @@ while True:
...
@@ -37,7 +37,7 @@ while True:
for
_
in
range
(
max_len
):
for
_
in
range
(
max_len
):
# 推理
# 推理
result
=
model
.
run
({
inputName
:
migraphx
.
argument
(
input_ids
)
})
result
=
model
.
run
({
inputName
:
input_ids
})
logits
=
[
float
(
x
)
for
x
in
result
[
0
].
tolist
()]
logits
=
[
float
(
x
)
for
x
in
result
[
0
].
tolist
()]
# 对于[UNK]的概率设为无穷小,模型的预测结果不可能是[UNK]
# 对于[UNK]的概率设为无穷小,模型的预测结果不可能是[UNK]
...
...
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