I coped the code of lab6 of the course and I am trying to generate the UI for the chatbot, but I am getting an error. I am suspecting that the error is due to the fact that I don’t have the correct JPG image for that part. I checked the documentation, but didn’t find that file anywhere.
Here is the code:
cb = cbfs()
file_input = pn.widgets.FileInput(accept=‘.pdf’)
button_load = pn.widgets.Button(name=“Load DB”, button_type=‘primary’)
button_clearhistory = pn.widgets.Button(name=“Clear History”, button_type=‘warning’)
button_clearhistory.on_click(cb.clr_history)
inp = pn.widgets.TextInput( placeholder=‘Enter text here…’)
bound_button_load = pn.bind(cb.call_load_db, button_load.param.clicks)
conversation = pn.bind(cb.convchain, inp)
jpg_pane = pn.pane.JPG( ‘./img/convchain.jpg’)
tab1 = pn.Column(
pn.Row(inp),
pn.layout.Divider(),
pn.panel(conversation, loading_indicator=True, height=300),
pn.layout.Divider(),
)
tab2= pn.Column(
pn.panel(cb.get_lquest),
pn.layout.Divider(),
pn.panel(cb.get_sources ),
)
tab3= pn.Column(
pn.panel(cb.get_chats),
pn.layout.Divider(),
)
tab4=pn.Column(
pn.Row( file_input, button_load, bound_button_load),
pn.Row( button_clearhistory, pn.pane.Markdown(“Clears chat history. Can use to start a new topic” )),
pn.layout.Divider(),
pn.Row(jpg_pane.clone(width=400))
)
dashboard = pn.Column(
pn.Row(pn.pane.Markdown(‘# ChatWithYourData_Bot’)),
pn.Tabs((‘Conversation’, tab1), (‘Database’, tab2), (‘Chat History’, tab3),(‘Configure’, tab4))
)
dashboard
The error is happening in line
jpg_pane = pn.pane.JPG( ‘./img/convchain.jpg’)
ValueError: JPG pane cannot parse string that is not a filename or URL.
The original code in the provided lab was
jpg_pane = pn.pane.Image( ‘./img/convchain.jpg’)
but that also caused an error.
Can anyone help or provide the image file to make the application run?