Views
No views yet
hebrew_aramaic_model_improved (local directory)>>heb<< for Hebrew and >>arc<< for Aramaic1python inference.py \
2 --model_path ./hebrew_aramaic_model_improved \
3 --text "בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם וְאֵת הָאָרֶץ" \
4 --direction he2arc1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
3model_path = "./hebrew_aramaic_model_improved"
4tokenizer = AutoTokenizer.from_pretrained(model_path)
5model = AutoModelForSeq2SeqLM.from_pretrained(model_path)
6
7# Translate Hebrew to Aramaic
8text = "בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם וְאֵת הָאָרֶץ"
9inputs = tokenizer(f">>heb<< {text}", return_tensors="pt", max_length=512, truncation=True)
10outputs = model.generate(**inputs, max_length=512, num_beams=4)
11translation = tokenizer.decode(outputs[0], skip_special_tokens=True)
12print(f"Aramaic: {translation}")1python inference.py \
2 --model_path ./hebrew_aramaic_model_improved \
3 --input_file input_texts.txt \
4 --output_file translations.txt \
5 --direction he2arcpython inference.py --model_path ./hebrew_aramaic_model_improved./hebrew_aramaic_model_improved/ with:model.safetensors: Model weightstokenizer_config.json: Tokenizer configurationmodel_info.json: Training information and metadatatraining_args.bin: Training argumentstest_results.json: Final evaluation resultsall_results.json: Complete training history>>heb<<: Hebrew (source language)>>arc<<: Aramaic (target language)he2arc_training.log>>heb<< and >>arc<<)>>arc<< token is properly added to tokenizer1@misc{marianmt-he2arc-targum-voc-shva,
2 author = {John Locke Jr.},
3 title = {Masoretic Hebrew to Targumic Aramaic (Onqelos & Jonathan) MarianMT Model},
4 year = {2025},
5 publisher = {Hugging Face},
6 journal = {Hugging Face model repository},
7 howpublished = {\url{https://huggingface.co/johnlockejrr/marianmt-he2arc-targum-voc-shva}},
8}