yvann-ba / Robby-chatbot

AI chatbot 🤖 for chat with CSV, PDF, TXT files 📄 and YTB videos 🎥 | using Langchain🦜 | OpenAI | Streamlit ⚡

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem loading XLSX file

DanielAttard opened this issue · comments

Just wondering whether you need to add openpyxl to requirements.txt to avoid this error:

robby

Its optional, as on Windows machines it works fine. Faced this issue on Linux OS, so yes it can be included optionaly i guess.

!pip install openpyxl

!wget -q https://www.dropbox.com/s/xxxxx/xxxx.zip
!unzip -q xxxx.zip

xls_file = r'/content/excel_file_example.xlsx'
output_csv = r'/content/excel_file_example.csv'

Read the XLS file using pandas and openpyxl as the engine

data = pd.read_excel(xls_file, engine='openpyxl')

Save the data as a CSV file

data.to_csv(output_csv, index=False)

Maybe adding this line of codes to the langchain csv loader

agent = create_csv_agent(OpenAI(temperature=0),
'/content/excel_file_example.csv',
verbose=True)

Removed XLSX support