UnicodeDecodeError Traceback (most recent call last)
Cell In[56], line 7
3 file = 'C:/Users/rasha/OneDrive/Documents/Projects/ttdash/OutdoorClothingCatalog_1000.csv'
4 loader = CSVLoader(file_path=file)
6 index = VectorstoreIndexCreator(
----> 7 vectorstore_cls=DocArrayInMemorySearch).from_loaders([loader])
8 response = index.query(prompt)
File ~\miniconda3\envs\ttdash_env\Lib\site-packages\langchain\indexes\vectorstore.py:72, in VectorstoreIndexCreator.from_loaders(self, loaders)
70 docs = []
71 for loader in loaders:
---> 72 docs.extend(loader.load())
73 return self.from_documents(docs)
File ~\miniconda3\envs\ttdash_env\Lib\site-packages\langchain\document_loaders\csv_loader.py:47, in CSVLoader.load(self)
45 with open(self.file_path, newline="", encoding=self.encoding) as csvfile:
46 csv_reader = csv.DictReader(csvfile, **self.csv_args) # type: ignore
---> 47 for i, row in enumerate(csv_reader):
48 content = "\n".join(f"{k.strip()}: {v.strip()}" for k, v in row.items())
49 try:
File ~\miniconda3\envs\ttdash_env\Lib\csv.py:111, in DictReader.__next__(self)
108 if self.line_num == 0:
109 # Used only for its side effect.
110 self.fieldnames
--> 111 row = next(self.reader)
112 self.line_num = self.reader.line_num
114 # unlike the basic reader, we prefer not to return blanks,
115 # because we will typically wind up with a dict full of None
116 # values
File ~\miniconda3\envs\ttdash_env\Lib\encodings\cp1252.py:23, in IncrementalDecoder.decode(self, input, final)
22 def decode(self, input, final=False):
---> 23 return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 4594: character maps to <undefined>
Any reason why even though I'm using the same CSV data used in the original notebook?