bhancockio / langchain-crash-course

418 stars 329 forks source link

fix unicode issue. #4

Open ELBEQQAL94 opened 3 months ago

ELBEQQAL94 commented 3 months ago

The error you're encountering is due to a character encoding issue when reading the file odyssey.txt. The TextLoader is attempting to read the file with a default encoding that can't decode certain characters in the file, leading to a UnicodeDecodeError.

To resolve this, you can explicitly specify the encoding when loading the text file. In most cases, using the "utf-8" encoding should work, but depending on the file's actual encoding, you may need to use a different one.

jaideeppoojary commented 3 months ago

The error you're encountering is due to a character encoding issue when reading the file odyssey.txt. The TextLoader is attempting to read the file with a default encoding that can't decode certain characters in the file, leading to a UnicodeDecodeError.

To resolve this, you can explicitly specify the encoding when loading the text file. In most cases, using the "utf-8" encoding should work, but depending on the file's actual encoding, you may need to use a different one.

Thanks for the fix and the detailed explanation.