Tuesday, May 30, 2023
HomeArtificial IntelligenceHow you can use Hugging Face fashions in your undertaking. | by...

How you can use Hugging Face fashions in your undertaking. | by Shubhendu ghosh | Could, 2023


picture credit score : https://medium.com/@s_eschweiler

Hugging Face is a library the place you’ll find machine studying fashions in your undertaking. It consists of quite a few transformers fashions which are utilized in Pure language processing. You can too discover laptop imaginative and prescient and audio fashions there. On this article we are going to see how you need to use them in your undertaking.

https://tenor.com/search/work-boss-gifs

Step 1. Perceive your requirement.

https://giphy.com/discover/what-do-you-want

Step 2. Select the mannequin

I had my studying mannequin on
solely choosed tag will probably be highlighted.

step 3. Examine the mannequin

go to https://huggingface.co/t5-base

step 4. See how different individuals used it

https://media.tenor.com/AKS0zwKDvMcAAAAd/mr-bean-exams.gif

step 5. study Pipeline

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("t5-base")

mannequin = AutoModelForSeq2SeqLM.from_pretrained("t5-base")

def translate(textual content, src_lang, tgt_lang):
translator = pipeline(
"translation",
mannequin=mannequin,
tokenizer=tokenizer,
src_lang=src_lang,
tgt_lang=tgt_lang,
)
translated_text = translator(textual content)
return translated_text
BYE!
https://www.icegif.com/wp-content/uploads/baby-yoda-bye-bye-icegif.gif



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments