<jupyter_start><jupyter_text>Install<jupyter_code>!pip3 install torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio==0.10.2+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html -qq
!apt install git-lfs

!pip install transformers[sentencepiece] sentencepiece 
!pip install datasets sacrebleu

!pip install jiwer -qq
!pip install --upgrade pip -qq
!apt-get update && apt-get install -y python3-opencv -qq
!pip install opencv-python -qq
!pip install pandas -qq
!pip install sklearn -qq
!pip install datasets -qq
%%bash
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
apt-get install git-lfs<jupyter_output><empty_output><jupyter_text>Test<jupyter_code>import torch
print(torch.__version__)
from transformers import AutoModelForSeq2SeqLM, DataCollatorForSeq2Seq, Seq2SeqTrainingArguments, Seq2SeqTrainer
model_checkpoint = "Helsinki-NLP/opus-mt-th-en"
model = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)
model_test = 'huak95/opus-mt-finetuned-50k-th-to-en'
model = AutoModelForSeq2SeqLM.from_pretrained(model_test)
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

model_for_predict = "huak95/opus-mt-finetuned-50k-th-to-en"
model_for_predict = 'Helsinki-NLP/opus-mt-th-en'

model = AutoModelForSeq2SeqLM.from_pretrained(model_for_predict)
tokenizer = AutoTokenizer.from_pretrained(model_for_predict)
inputs = tokenizer("แวงกี้เอสพีเอดาร์กช็อกโกแลต85 เปอร์เซ็นต์ชนิดแท่ง",
                   return_tensors = "pt", padding=True)
                   
outputs = model.generate(inputs["input_ids"],
                         max_length=40,
                         num_beams=4,
                         early_stopping=True)

print(tokenizer.decode(outputs[0]))<jupyter_output><pad> Wangky, SPADARK, 85 percent of the bar type.
{'fraction_non_alphanumeric': 0.10882842865074958, 'fraction_numerical': 0.0277623542476402, 'mean_word_length': 4.648902821316614, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '366921', 'license': 'Apache-2.0', 'n_tokens_mistral': 700, 'n_tokens_neox': 661, 'n_words': 109, 'path': '.ipynb_checkpoints/Install_Library_v3-checkpoint.ipynb', 'repo_name': 'huak95/machine-translation', 'size': '1801'}