Aarif1430/english-to-hindi
Viewer • Updated • 128k • 136 • 7
How to use Swekerr/eng2hindi 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="Swekerr/eng2hindi") # Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("Swekerr/eng2hindi")
model = AutoModelForSeq2SeqLM.from_pretrained("Swekerr/eng2hindi")# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("Swekerr/eng2hindi")
model = AutoModelForSeq2SeqLM.from_pretrained("Swekerr/eng2hindi")A English to Hindi Translation Model.
This is the model card of a 🤗 transformers model that has been pushed on the Hub.
Use the code below to get started with the model.
from transformers import pipeline
checkpoint = "Swekerr/eng2hindi"
translate = pipeline("translation", model=checkpoint)
translate("Failure is the pillar of success")
>>> [{'translation_text': 'असफलता सफलता का स्तम्भ है।'}]
# 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="Swekerr/eng2hindi")