Error on Gradio - TypeError: issubclass() arg 1 must be a class

I’m totally new into programming, and basically using GitHub, HuggingFace and ChatGTP to “clone” a ChatGPT for my PDFs files without OpenAI API.

I’m trying to run this code locally: GitHub - misbahsy/chat-your-data-self-hosted: This repo guides you through building a chatbot on your own data with self hosted LLM
But I receive a “TypeError: issubclass() arg 1 must be a class” when running on Line 93, which is:

submit.click(chat, inputs=[hf_token_textbox, message, state, agent_state], outputs=[chatbot, state])

Using latest Python, Gradio and all requirements.

How can I fix this issue?

Thanks!

Hi @neeewwww ! This is a bug that got fixed yesterday but the fix is not out on pypi. In the meantime, I suggest you remove type hints from the chat function in order to avoid getting the error.

1 Like