New token key requirements? How do I call to get a token here:

#51
by awacke1 - opened

How can I get and supply a token here? Is there a URL you can give to generate one maybe..

Line 41 is generate response below.

Exception: Authentication is required now, but no cookies provided
Traceback:
File "/home/user/.local/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
exec(code, module.dict)
File "/home/user/app/app.py", line 41, in
response = generate_response(user_input)
File "/home/user/app/app.py", line 35, in generate_response
chatbot = hugchat.ChatBot()
File "/home/user/.local/lib/python3.8/site-packages/hugchat/hugchat.py", line 19, in init
raise Exception("Authentication is required now, but no cookies provided") ....

def generate_response(prompt):
chatbot = hugchat.ChatBot()
response = chatbot.chat(prompt)
return response

with response_container:
if user_input:
response = generate_response(user_input)
st.session_state.past.append(user_input)
st.session_state.generated.append(response)
if st.session_state['generated']:
for i in range(len(st.session_state['generated'])):
message(st.session_state['past'][i], is_user=True, key=str(i) + '_user')
message(st.session_state['generated'][i], key=str(i))

I'm having the same issue. I am trying to follow this streamlit blog here: https://blog.streamlit.io/how-to-build-an-llm-powered-chatbot-with-streamlit/

Sign up or log in to comment