Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
Jakub Kaczmarek | 40c36dce44 | |
Jakub Kaczmarek | 5bc8f3f6f7 | |
Jakub Kaczmarek | c8247f077f | |
Jakub Kaczmarek | ab56101d2c | |
Jakub Kaczmarek | f8892f9209 |
10519
dev-0/out.tsv
10519
dev-0/out.tsv
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,18 @@
|
||||||
|
from transformers import pipeline
|
||||||
|
import lzma
|
||||||
|
|
||||||
|
generator = pipeline("text-generation", model="gpt2")
|
||||||
|
|
||||||
|
with open("test-A/in.tsv", "r") as input_file, open(
|
||||||
|
"test-A/out.tsv", "w"
|
||||||
|
) as output_file:
|
||||||
|
for line in input_file:
|
||||||
|
line = line.rstrip()
|
||||||
|
line = line.replace("\\n", " ")
|
||||||
|
|
||||||
|
prompt = line.split("\t")[6]
|
||||||
|
|
||||||
|
result = generator(prompt, max_new_tokens=1, num_return_sequences=1)[0][
|
||||||
|
"generated_text"
|
||||||
|
]
|
||||||
|
output_file.write(f"{result.split()[-1]}:1\n")
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue