I am trying to use transformers in a task of building a chatbot
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, GenerationConfig, TrainingArguments, trainer
import torch
import time
import pandas as pd
import random
import numpy as np
import os
import string
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer, TfidfVectorizer
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.pipeline import Pipeline
from sklearn.decomposition import LatentDirichletAllocation
#import evaluate
and before that I install the required librairies
%pip install --upgrade pip
%pip install --disable-pip-version-check
torch==1.13.1
torchdata==0.5.1 --quiet
%pip install
transformers==4.27.2
datasets==2.11.0
evaluate==0.4.0
rouge_score==0.1.2
loralib==0.1.1
peft==0.3.0 --quiet
But sometimes I encounter this error
RuntimeError: Failed to import transformers.training_args because of the following error (look up to see its traceback):
/usr/local/lib/python3.10/site-packages/_XLAC.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZNK5torch4lazy17LazyGraphExecutor16ShouldSyncTensorERKN3c1013intrusive_ptrINS0_10LazyTensorENS2_6detail34intrusive_target_default_null_typeIS4_EEEE
Sometimes, when I run the cells to install packages and reload the kernel as required, and then import the necessary libraries, everything works fine. However, at other times, even though I follow the same steps, I encounter this error.