yvann-ba / Robby-chatbot

AI chatbot 🤖 for chat with CSV, PDF, TXT files 📄 and YTB videos 🎥 | using Langchain🦜 | OpenAI | Streamlit ⚡
MIT License
766 stars 287 forks source link

Problem loading XLSX file #52

Closed DanielAttard closed 9 months ago

DanielAttard commented 1 year ago

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

robby

godwin3737 commented 1 year ago

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

FayElhassan commented 11 months ago

!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)

yvann-ba commented 9 months ago

Removed XLSX support