Runtime Error - Failed to import transformers.models.bart.modeling_tf_bart

Hello kind stranger,

Total Newb here, so apologies in advance.

Our vendor implemented the bart model in Azure Synapse Notebook using the following script. It worked fine up until yesterday around noon (EST).

## Imported libraries

!pip install torch transformers

# !conda install -c conda-forge transformers

# essential libries

import torch
import re
import os
import pandas as pd
import numpy as np
import warnings
warnings.filterwarnings(‘ignore’)

# Model libraries

from transformers import pipeline

model = pipeline(“zero-shot-classification”, model=“facebook/bart-large-mnli”)

# Azure library
from azureml.core import Workspace, Dataset

We are getting the following runtime error message

RuntimeError: Failed to import transformers.models.bart.modeling_tf_bart because of the following error (look up to see its traceback):
cannot import name ‘call_context’ from ‘tensorflow.python.keras.engine’ (/home/trusted-service-user/cluster-env/env/lib/python3.10/site-packages/tensorflow/python/keras/engine/init.py)

Is there anything we are missing on our script, or anything we can do to fix the issue? Thanks again for your help. :slightly_smiling_face: