I am trying to host my chatbot on huggingface space. I encountered this issue whereby when I tried to add the value parameter into the gradio Chatbot, I get a bunch of errors. It works when I try to run locally on my jupyter lab.
snippet of my code below:
conversation_chain = ConversationalRetrievalChain.from_llm(llm=llm, retriever=retriever, memory=memory, combine_docs_chain_kwargs={“prompt”: custom_prompt})
Define an introductory message
intro_message = [{“role”: “assistant”, “content”: “Hello! I’m your virtual assistant!”}]
def chat(message, history):
result = conversation_chain.invoke({“question”: message})
return result[“answer”]
Gradio Chat Interface
view = gr.ChatInterface(
fn=chat,
chatbot = gr.Chatbot(avatar_images=[“guru.png”, “guru.png”], type=“messages”, value=intro_message),
type=“messages”
)
Launch the app
if name == “main”:
view.launch()
Error message shown on huggingface spaces logs below:
ReferenceError: scroll is not defined
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:869:9
at each (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:388:10)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:835:335
at Object.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
at Object.default (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:1064:62)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-CClG50To.js:14423:65
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-CClG50To.js:14424:5
at Object.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:1028:48
at Proxy.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
ReferenceError: scroll is not defined
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:869:9
at each (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:388:10)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:835:335
at Object.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
at Object.default (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:1064:62)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-CClG50To.js:14423:65
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-CClG50To.js:14424:5
at Object.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:1028:48
at Proxy.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
ReferenceError: scroll is not defined
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:869:9
at each (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:388:10)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:835:335
at Object.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
at Object.default (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:1064:62)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-CClG50To.js:14423:65
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-CClG50To.js:14424:5
at Object.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:1028:48
at Proxy.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
ReferenceError: scroll is not defined
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:869:9
at each (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:388:10)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:835:335
at Object.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
at Object.default (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:1064:62)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-CClG50To.js:14423:65
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-CClG50To.js:14424:5
at Object.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:1028:48
at Proxy.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
ReferenceError: scroll is not defined
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:869:9
at each (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:388:10)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:835:335
at Object.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
at Object.default (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:1064:62)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-CClG50To.js:14423:65
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-CClG50To.js:14424:5
at Object.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
at file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/Index55-D5oefuYR.js:1028:48
at Proxy.$$render (file:///usr/local/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/ssr-RaXq3SJh.js:423:16)
Traceback (most recent call last):
File “/home/user/app/app.py”, line 103, in
Anybody encountered this before?