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