Soulter / hugging-chat-api

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

No response #220

Closed rednag closed 3 months ago

rednag commented 6 months ago

Describe the bug I'm authenticated successfully and I see on huggingchat that new conversations are created, but all of them are in an error mode and I'm not receiving any response from the model. I'm trying to process large amount of texts to summarize, Idk whether this is the issue, but when I'm pasting the text in a UI created conversation I at least get a response from the model.

To Reproduce I've tried to build the pipeline in a Jupyter notebook and at the beginning it worked for simple queries like "Are you there?", but now I don't event get an answer for this simple queries.

from hugchat import hugchat
from hugchat.login import Login
import os
import base64

cookies = "./cookies/"
sign = Login(MAIL, base64.b64decode(PW).decode('utf-8'))
cookies = sign.login(cookie_dir_path=cookies, save_cookies=True)

chat = hugchat.ChatBot(cookies=cookies.get_dict(), default_llm=1) 

query = "Are you there?"

answer = chat.query(query)

print(answer.text)

Expected behavior I'd expect an answer.

Screenshots Not necessary.

Additional context What Operating System are you using? Ubuntu 22.04.4 What Python version are you using? Python 3.10.12 What version of hugchat are you using? 0.4.6

github-actions[bot] commented 6 months ago

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

Whitelisted1 commented 6 months ago

Try using print(answer.wait_until_done()) instead of print(answer.text)

Soulter commented 6 months ago

Try using print(answer.wait_until_done()) instead of print(answer.text)

Or you can use print(answer) directly.

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.