Farzad-R / LLM-Zero-to-Hundred

This repository contains different LLM chatbot projects (RAG, LLM agents, etc.) and well-known techniques for training and fine tuning LLMs.
266 stars 142 forks source link

AttributeError: 'NoneType' object has no attribute 'lower' #3

Closed sf6532 closed 7 months ago

sf6532 commented 7 months ago

When I run python src/raggpt_app.py

Any idea why ?

Farzad-R commented 7 months ago

Due to the comment that you sent me on youtube:

This error is not because of the chatbot's codes. It is an AttributeError occurring in Openai's backend. The chatbot is using Azure to access Openai's models, and my guess is you either are using Openai's GPT model directly from OpenAI or if you are using Azure, you haven't set the credentials properly. So, depending on where you are taking the GPT model from, the solution would be different. If you are using Azure, ensure that all required environment variables or configurations related to the OpenAI API (like the API key and the API type). If you are using the GPT model directly from OpenAI, you need to both set the credentials and also change the code for generating the response from the model. In the previous comments under mikew2883, I have explained these steps in detail. I hope this help and you can solve the problem.