Error on HF but not in Colab - SOLVED
Calling this agent generates an error on my HF Space but not in Google Colab:ask the questioncontext = get_context_from_text()st.write(“”)question = question1myanswer = agent.run(“Answer the question inquestionusing the context incontext”, question=question, context=context)st.write(f"Question: {question}“)st.write(f”  Answer: {myanswer}")ValueError: Error 400: {‘error’: ‘Authorization header is correct, but the token seems invalid’}I’m using the StarCoder model.  The only difference between the Colab and HF versions is that I login to HF from Colab.  Trying to login to HF from a Space generates an error.  I have verified that both the ‘question’ and the ‘context’ are valid.  Why am I getting an error on HF but not Colab?  Thanks.
2023-06-21T18:44:45Z
Closed.  I wasn’t accessing the token environmental value correctly.  Now I am and it works fine.
2023-12-04T12:29:01Z
Hi there, please give an example of how to access the token the right way. Having the same error currently