the gradio throws error: Traceback (most recent call last):
File “C:\Users\danya\PycharmProjects\DiDefBackend\DiDef\SentenceTransformer.py”, line 45, in
client = Client(
File “C:\Users\danya\AppData\Local\Programs\Python\Python39\lib\site-packages\gradio_client\client.py”, line 171, in init
self._info = self._get_api_info()
File “C:\Users\danya\AppData\Local\Programs\Python\Python39\lib\site-packages\gradio_client\client.py”, line 564, in get_api_info
info = r.json()
File “C:\Users\danya\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx_models.py”, line 764, in json
return jsonlib.loads(self.content, **kwargs)
File "C:\Users\danya\AppData\Local\Programs\Python\Python39\lib\json_init.py", line 346, in loads
return _default_decoder.decode(s)
File “C:\Users\danya\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Users\danya\AppData\Local\Programs\Python\Python39\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
why? My code is very simple:
from gradio_client import Client
client = Client(
src = “GoldDany/DiDefBackend”, #my Space is public
)
result = client.predict(
text=“Hello!!”,
api_name=“/predict”,
)
print(result)