|
|
from gradio_client import Client
|
|
|
import time
|
|
|
|
|
|
try:
|
|
|
print("Connecting to Space...")
|
|
|
|
|
|
client = Client("https://oldmonk69-dock.hf.space", timeout=120)
|
|
|
print("Connected successfully!")
|
|
|
|
|
|
|
|
|
result = client.predict("Hello", api_name="/predict")
|
|
|
print(f"Test result: {result}")
|
|
|
|
|
|
except Exception as e:
|
|
|
print(f"Connection failed: {e}")
|
|
|
print("Trying alternative connection method...")
|
|
|
|
|
|
|
|
|
try:
|
|
|
client = Client("oldmonk69/Dock", timeout=120)
|
|
|
print("Connected with space name!")
|
|
|
except Exception as e2:
|
|
|
print(f"Alternative connection also failed: {e2}") |