update
This commit is contained in:
parent
6962418bb1
commit
20bcf01be7
@ -6,10 +6,6 @@ from datasets import load_dataset
|
||||
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# Nastavenia
|
||||
# -----------------------------
|
||||
|
||||
DATASET_NAME = "tatsu-lab/alpaca"
|
||||
SPLIT = "train"
|
||||
|
||||
@ -41,10 +37,7 @@ def is_empty(value):
|
||||
|
||||
|
||||
def load_already_done(path):
|
||||
"""
|
||||
Ak skript spadne alebo ho zastavíš, vie pokračovať.
|
||||
Načíta už preložené riadky.
|
||||
"""
|
||||
|
||||
if not path.exists():
|
||||
return []
|
||||
|
||||
@ -58,10 +51,7 @@ def load_already_done(path):
|
||||
|
||||
|
||||
def translate_batch(texts, tokenizer, model, device):
|
||||
"""
|
||||
Preloží batch textov z angličtiny do slovenčiny.
|
||||
Prázdne texty nechá prázdne.
|
||||
"""
|
||||
|
||||
results = [""] * len(texts)
|
||||
|
||||
non_empty_indices = []
|
||||
@ -108,7 +98,6 @@ def translate_batch(texts, tokenizer, model, device):
|
||||
return results
|
||||
|
||||
|
||||
# Main
|
||||
|
||||
def main():
|
||||
print("Loading dataset...")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user