1. Learn
  2. /
  3. Courses
  4. /
  5. Working with Hugging Face

Connected

Exercise

Using AutoClasses

You’ve seen how tokenizers work and explored their role in preparing text for models. Now, let’s take it a step further by combining AutoModels and AutoTokenizers with the pipeline() function. It's a nice balance of control and convenience.

Continue with the sentiment analysis task and combine AutoClasses with the pipeline module.

AutoModelForSequenceClassification, AutoTokenizer and pipeline from the transformers library have already been imported for you.

Instructions

100 XP
  • Download the model and tokenizer and save as my_model and my_tokenizer, respectively.
  • Create the pipeline and save as my_pipeline.
  • Predict the output using my_pipeline and save as output.