Instructions to use megalaa/english-coptic-translator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use megalaa/english-coptic-translator with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="megalaa/english-coptic-translator")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("megalaa/english-coptic-translator") model = AutoModelForSeq2SeqLM.from_pretrained("megalaa/english-coptic-translator") - Notebooks
- Google Colab
- Kaggle
How To Use This Model
Sahidic Example With No Confidence Score
from transformers import pipeline
pipe = pipeline(model="megalaa/english-coptic-translator", trust_remote_code=True)
output = pipe("Jesus Christ")
print(output)
# {'translation': 'ⲓⲏⲥⲟⲩⲥ ⲡⲉⲭⲣⲓⲥⲧⲟⲥ.'}
Parameters
By default, this models translates from English to Sahidic Coptic.
Use to_bohairic=True if you are translating from English to Bohairic Coptic.
Additionally, use output_confidence=True if you want to output the model confidence.
Bohairic Example With Confidence Score
from transformers import pipeline
pipe = pipeline(model="megalaa/english-coptic-translator", trust_remote_code=True)
output = pipe("Jesus Christ", to_bohairic=True, output_confidence=True)
print(output)
# {'translation': 'ⲓⲏⲥⲟⲩⲥ ⲡⲓⲭⲣⲓⲥⲧⲟⲥ', 'confidence': 0.9277395772214944}
- Downloads last month
- 867