iluksic's picture
Created Computer Use Agent
2baba5d
Raw
History Blame Contribute Delete
1.05 kB
#!/usr/bin/env python3
"""
HuggingFace Spaces deployment entrypoint for Computer Use Agent.
"""
import gradio as gr
from gradio_demo import GradioDemo
def main():
"""Launch the Gradio interface for HuggingFace Spaces."""
# Create demo instance
demo_app = GradioDemo()
demo = demo_app.create_interface()
# Enable queue for rate limiting and concurrency control
demo.queue(
max_size=20, # Max 20 requests in queue
default_concurrency_limit=3, # Max 3 concurrent task executions
)
# Launch with HuggingFace Spaces configuration
demo.launch(
server_name="0.0.0.0", # Listen on all interfaces for HF Spaces
server_port=7860, # Default HF Spaces port
share=False, # No sharing needed, HF Spaces handles this
show_error=True, # Show errors for debugging
quiet=False, # Show startup logs
max_threads=10, # Support up to 10 concurrent connections
)
if __name__ == "__main__":
main()