Open Gopichand995 opened 1 year ago
I am currently using "transformers" with a version of 4.26.0...i would like to know how to rectify the following module issue...here is the code
import pandas as pd from ast import literal_eval
from cdqa.utils.filters import filter_paragraphs from cdqa.utils.download import download_model, download_bnpp_data from cdqa.pipeline.cdqa_sklearn import QAPipeline
download_bnpp_data(dir=r'C:\Users\04647U744\Desktop\exp') download_model(model='bert-squad_1.1', dir=r'C:\Users\04647U744\Desktop\exp')
df = pd.read_csv(r'C:\Users\04647U744\Documents\Github\CASH_sfaidebtreducer_WSP\data\paragraphs.csv', converters={'paragraphs': literal_eval}) df = filter_paragraphs(df)
cdqa_pipeline = QAPipeline(reader=r'C:\Users\04647U744\Desktop\exp\bert_qa.joblib')
cdqa_pipeline.fit_retriever(df)
query = 'what is round robin assignment rule?' prediction = cdqa_pipeline.predict(query)
print('query: {}\n'.format(query)) print('answer: {}\n'.format(prediction[0])) print('title: {}\n'.format(prediction[1])) print('paragraph: {}\n'.format(prediction[2]))
Traceback (most recent call last): File "C:\Users\04647U744\Documents\Github\CASH_sfaidebtreducerWSP\model\cdqa.py", line 18, in
cdqa_pipeline = QAPipeline(reader=r'C:\Users\04647U744\Desktop\exp\bert_qa.joblib')
File "C:\Users\04647U744\Documents\Github\CASH_sfaidebtreducer_WSP\cdqa\pipeline\cdqa_sklearn.py", line 82, in init
self.reader = joblib.load(reader)
File "C:\Users\04647U744\Anaconda3\lib\site-packages\joblib\numpy_pickle.py", line 587, in load
obj = _unpickle(fobj, filename, mmap_mode)
File "C:\Users\04647U744\Anaconda3\lib\site-packages\joblib\numpy_pickle.py", line 506, in _unpickle
obj = unpickler.load()
File "C:\Users\04647U744\Anaconda3\lib\pickle.py", line 1212, in load
dispatchkey[0]
File "C:\Users\04647U744\Anaconda3\lib\pickle.py", line 1528, in load_global
klass = self.find_class(module, name)
File "C:\Users\04647U744\Anaconda3\lib\pickle.py", line 1579, in find_class
import(module, level=0)
ModuleNotFoundError: No module named 'transformers.modeling_bert'