Soulter / hugging-chat-api

HuggingChat Python API🤗
GNU Affero General Public License v3.0
859 stars 123 forks source link

Getting error while logging in: Exception: Something went wrong! #217

Closed yuktasarode closed 3 months ago

yuktasarode commented 6 months ago

Describe the bug I am trying to follow the basic tutorial of using HugChat. However, I have been encountering an error while logging in. The error traceback is as follows:

Exception                                 Traceback (most recent call last)
<ipython-input-20-53ba471d7b0d> in <cell line: 2>()
      1 prompt = "What is Streamlit?"
----> 2 response = generate_response(prompt, hf_email, hf_pass)

<ipython-input-17-e15b070cc35a> in generate_response(prompt_input, email, passwd)
      3     # Hugging Face Login
      4     sign = Login(email, passwd)
----> 5     cookies = sign.login()
      6     # Create ChatBot
      7     chatbot = hugchat.ChatBot(cookies=cookies.get_dict())

/usr/local/lib/python3.10/dist-packages/hugchat/login.py in login(self)
    124     def login(self) -> requests.sessions.RequestsCookieJar:
    125         self.SigninWithEmail()
--> 126         location = self.getAuthURL()
    127         if self.grantAuth(location):
    128             return self.cookies

/usr/local/lib/python3.10/dist-packages/hugchat/login.py in getAuthURL(self)
     92                 raise Exception("No authorize url found, please check your email or password.")
     93         else:
---> 94             raise Exception("Something went wrong!")
     95
     96     def grantAuth(self, url: str) -> int:
Exception: Something went wrong!

How should I resolve this? The email and password added are correct because I get emails whenever I try to run the code.

github-actions[bot] commented 6 months ago

Hi! Thanks for your issue, we will deal with your issue as soon as possible.

MexicanBauss commented 6 months ago

You are getting the same bug I posted about in this Issue. So far I've not found any solution. It might be due to some changes in the API of HuggingfaceChat

github-actions[bot] commented 4 months ago

This issue was marked as stale because of inactivity.

github-actions[bot] commented 3 months ago

This issue was closed because of inactivity.