Compare commits

...

5 Commits
master ... gpt

Author SHA1 Message Date
Jakub Kaczmarek 40c36dce44 Final out fix 2023-06-09 02:33:57 +02:00
Jakub Kaczmarek 5bc8f3f6f7 Fix output 2023-06-09 02:26:52 +02:00
Jakub Kaczmarek c8247f077f Fix output 2023-06-09 02:24:43 +02:00
Jakub Kaczmarek ab56101d2c Remove results for dev-0 2023-06-09 02:07:56 +02:00
Jakub Kaczmarek f8892f9209 Add gpt2 solution 2023-06-09 01:55:15 +02:00
3 changed files with 7432 additions and 10519 deletions

File diff suppressed because it is too large Load Diff

18
gpt_predict.py Normal file
View File

@ -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")

7414
test-A/out.tsv Normal file

File diff suppressed because it is too large Load Diff