You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though HuggingFaceTexrGen object for any HuggingFace LLM shows pandasai.huggingfacetextgen object as its type and it is an instance of LLM class, yet on executing pandasai code of chat function (pai.chat method), I get JSONDecode error due to resp.json() line. The response is a string from the chat method but resp.json() is trying to convert to a json object ehich thrrows JSON Decode Error.
Kindly check the chat(), call method in huggingface_text_gen.py code inside extensions (huggingface).
Looking forward to a solution so that HuggingFace models are compatible to work with chat function of pandasai.
🐛 Describe the bug
'''
import pandasai as pai
from pandasai_huggingface import HuggingFaceTextGen
Hey @SimranAnand1 let's consider this ticket as a duplicate of #1577, as the JSON Decode Error does not happen for all LLMs. And the OpenAI and Google LLMs data extensions work in the 3.x. Thanks for sharing further info. If you have to use hugging face models, for now please revert to the 2.4. We will notify you as soon as we fix the hugging face models in the 3.x, which is currently in Beta release.
System Info
Though HuggingFaceTexrGen object for any HuggingFace LLM shows pandasai.huggingfacetextgen object as its type and it is an instance of LLM class, yet on executing pandasai code of chat function (pai.chat method), I get JSONDecode error due to resp.json() line. The response is a string from the chat method but resp.json() is trying to convert to a json object ehich thrrows JSON Decode Error.
Kindly check the chat(), call method in huggingface_text_gen.py code inside extensions (huggingface).
Looking forward to a solution so that HuggingFace models are compatible to work with chat function of pandasai.
🐛 Describe the bug
'''
import pandasai as pai
from pandasai_huggingface import HuggingFaceTextGen
employees_data = {
'EmployeeID': [1, 2, 3, 4, 5],
'Name': ['John', 'Emma', 'Liam', 'Olivia', 'William'],
'Department': ['HR', 'Sales', 'IT', 'Marketing', 'Finance']
}
salaries_data = {
'EmployeeID': [1, 2, 3, 4, 5],
'Salary': [5000, 6000, 4500, 7000, 5500]
}
employees_df = pai.DataFrame(employees_data)
salaries_df = pai.DataFrame(salaries_data)
llm= HuggingFaceTextGen(inference_url="http://127.0.0.1:8080")
pai.config.set({"llm":llm})
pai.chat("Who gets paid the most?", employees_df, salaries_df)
The text was updated successfully, but these errors were encountered: