Dock / chat.py
oldmonk69's picture
Upload 2 files
af07018 verified
raw
history blame contribute delete
764 Bytes
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}")