-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
h2oGPT Client 401-Status caused by raising KeyError: 'dependencies' in client.py gradio_client v.0.6.1 #1111
Comments
What are you running exactly as client, I cannot tell. E.g. are you are using plain gradio client to talk to h2oGPT? Or some other way? What are your commands? |
I cant bellieve i forgot to paste the code am using for the client. def test_readme_example(local_server):
import os
import asyncio
from h2ogpt_client import Client
if local_server:
client = Client("http://0.0.0.0:7860")
else:
h2ogpt_key = os.getenv("H2OGPT_KEY") or os.getenv("H2OGPT_H2OGPT_KEY")
# this actually prints the h20gpt_key that i set with --h20gpt_keys=[....] :param
print (h20gpt_key)
if h2ogpt_key is None:
return
# if you have API key for public instance:
client = Client("http://xx.xxxx.xxxxx.xx:7860", h2ogpt_key=h2ogpt_key)
# Text completion
text_completion = client.text_completion.create()
response = asyncio.run(text_completion.complete("Hello world"))
print("asyncio text completion response: %s" % response)
# Text completion: synchronous
response = text_completion.complete_sync("Hello world")
print("sync text completion response: %s" % response)
# Chat completion
chat_completion = client.chat_completion.create()
reply = asyncio.run(chat_completion.chat("Hey!"))
print("asyncio text completion user: %s gpt: %s" % (reply["user"], reply["gpt"]))
chat_history = chat_completion.chat_history()
print("chat_history: %s" % chat_history)
# Chat completion: synchronous
reply = chat_completion.chat_sync("Hey!")
print("sync chat completion gpt: %s" % reply["gpt"])
test_readme_example(local_server=False) |
Can u please look at the above code i pasted, and lmk if u know the causes of this issue. Thanks |
Sorry for not responding, I don't have any good ideas. @this maintains the OpenAI compliant API you are trying. Maybe he has ideas. |
Its the --auth=... what causes the error. |
gradio 3 doesn't support auth via API. |
The error am getting.
I try debugging it on my own, here's the actual cause of the error
file name: ..../lib/python3.11/site-packages/gradio_client/client.py", line 134,
the var self.config is set by calling this function: self._get_config()
I know 401 is unauthorized. but am certain the access token is valid. and i set the --allow_api and --api_open to True in my docker run command. below is the command i use to start the container.
docker command
Libs and system specs
gradio-client related
v0.6.1 as required in the docs
https://github.com/h2oai/h2ogpt/releases/download/client-nightly-2023-11-16/h2ogpt_client-0.1.0-py3-none-any.whl
nightly release h2ogpt-client:latest
misc
I found the following issues interesting.
gradio-app/gradio#3805
#946
The text was updated successfully, but these errors were encountered: