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
OpenDAS
Megatron-LM
Commits
fc06e7a2
Commit
fc06e7a2
authored
Dec 10, 2021
by
zihanl
Browse files
update api prompt
parent
57c8996e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
tasks/knwl_dialo/prompt.py
tasks/knwl_dialo/prompt.py
+3
-2
No files found.
tasks/knwl_dialo/prompt.py
View file @
fc06e7a2
...
...
@@ -17,6 +17,7 @@
import
json
import
torch
import
requests
from
nltk
import
word_tokenize
from
megatron
import
mpu
from
megatron
import
get_args
...
...
@@ -104,12 +105,12 @@ def generate_samples_by_calling_api():
fname
=
open
(
args
.
sample_input_file
,
"r"
)
test_sample_list
=
fname
.
readlines
()
# create output file
fname_out
=
open
(
sample_output_file
,
"w"
)
fname_out
=
open
(
args
.
sample_output_file
,
"w"
)
# call the api to get the output generations
for
test_sample
in
test_sample_list
:
test_sample
=
test_sample
.
strip
()
splits
=
input_str
.
split
(
"
\t
"
)
splits
=
test_sample
.
split
(
"
\t
"
)
topic
=
splits
[
0
]
# prepare the inputs for the api
...
...
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