The Gradio API is not working

Python39

I think this is probably the culprit this time.

Gradio 5 only works with Python 3.10 or later on both the server and client, so I think the error is occurring because the versions are different between the client and server.
I don’t know if this error can be potentially resolved…

The simplest solution is to use Python 3.10 or later.:sweat_smile:

# pip install -U gradio_client (in Python 3.9 environment)
import subprocess
subprocess.run("pip show gradio_client", shell=True) # Version: 1.3.0 (Release date: 2024.08.08)
from gradio_client import Client

client = Client(src="John6666/apitest1") # Gradio 4.41.0
result = client.predict(text="Hello!!", api_name="/predict")
print(result) # [0.010964062064886093, 0.02713009901344776, -0.024556249380111694, 0.01713254489004612, 0.04088324308395386, -0.005583592690527439, 0.015990763902664185,...

client = Client(src="GoldDany/DiDefBackend") # Gradio 5.42.0
result = client.predict(text="Hello!!", api_name="/predict")
print(result) # error