There is a model which i want to use in HF. And when i use the api, i get the following error.
Traceback (most recent call last):
File "/home/akin/Schreibtisch/mltoolkit/src/main.py", line 13, in <module>
from src import gui
File "/home/akin/Schreibtisch/mltoolkit/src/gui.py", line 9, in <module>
from src.pubsub import Tools
File "/home/akin/Schreibtisch/mltoolkit/src/pubsub.py", line 16, in <module>
from src.tools import bullet_to_text, summarizer, personality_extractor, teaser, cta, teaser_cta, headline, fixtext, \
File "/home/akin/Schreibtisch/mltoolkit/src/tools/images.py", line 18, in <module>
result = client.predict(
^^^^^^^^^^^^^^^
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/gradio_client/client.py", line 292, in predict
return self.submit(*args, api_name=api_name, fn_index=fn_index).result()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/gradio_client/client.py", line 1131, in result
return super().result(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/gradio_client/client.py", line 798, in _inner
predictions = _predict(*data)
^^^^^^^^^^^^^^^
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/gradio_client/client.py", line 827, in _predict
result = utils.synchronize_async(self._ws_fn, data, hash_data, helper)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/gradio_client/utils.py", line 540, in synchronize_async
return fsspec.asyn.sync(fsspec.asyn.get_loop(), func, *args, **kwargs) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/fsspec/asyn.py", line 103, in sync
raise return_result
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/fsspec/asyn.py", line 56, in _runner
result[0] = await coro
^^^^^^^^^^
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/gradio_client/client.py", line 1055, in _ws_fn
async with websockets.connect( # type: ignore
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/websockets/legacy/client.py", line 637, in __aenter__
return await self
^^^^^^^^^^
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/websockets/legacy/client.py", line 655, in __await_impl_timeout__
return await self.__await_impl__()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/websockets/legacy/client.py", line 662, in __await_impl__
await protocol.handshake(
File "/home/akin/miniconda3/envs/ml_toolkit/lib/python3.11/site-packages/websockets/legacy/client.py", line 329, in handshake
raise InvalidStatusCode(status_code, response_headers)
websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 403
Process finished with exit code 1
client = Client("https://playgroundai-playground-v2-5.hf.space/--replicas/mqedc/")
result = client.predict(
"Hello!!", # str in 'Prompt' Textbox component
"Hello!!", # str in 'Negative prompt' Textbox component
True, # bool in 'Use negative prompt' Checkbox component
0, # float (numeric value between 0 and 2147483647) in 'Seed' Slider component
256, # float (numeric value between 256 and 1536) in 'Width' Slider component
256, # float (numeric value between 256 and 1536) in 'Height' Slider component
0.1, # float (numeric value between 0.1 and 20) in 'Guidance Scale' Slider component
True, # bool in 'Randomize seed' Checkbox component
api_name="/run"
)
print(result)