Spaces:
No application file
No application file
File size: 6,802 Bytes
46074e2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
#!/usr/bin/env python3
"""
Hackathon Demo Launcher
LLM-Agent-Designed Obstacle-Passing Vehicle System
Track 3: Agentic Demo Showcase
"""
import sys
import os
import ssl
# SSL workaround for Gradio/network issues
try:
import certifi
os.environ['SSL_CERT_FILE'] = certifi.where()
except ImportError:
pass
# Try to disable SSL verification as a workaround
try:
ssl._create_default_https_context = ssl._create_unverified_context
except AttributeError:
pass
import webbrowser
import time
def print_banner():
"""Print the hackathon banner"""
print("=" * 80)
print("π€π LLM-AGENT-DESIGNED VEHICLE SYSTEM - HACKATHON DEMO")
print(" TRACK 3: AGENTIC DEMO SHOWCASE")
print("=" * 80)
print()
def check_dependencies():
"""Check if all required dependencies are installed"""
print("π Checking dependencies...")
missing_deps = []
# Check for required packages
required_packages = [
('gradio', 'gradio'),
('pybullet', 'pybullet'),
('transformers', 'transformers'),
('torch', 'torch'),
('Pillow', 'PIL'),
('imageio', 'imageio'),
('numpy', 'numpy')
]
for package_name, import_name in required_packages:
try:
__import__(import_name)
print(f" β
{package_name}")
except ImportError:
print(f" β {package_name} - MISSING")
missing_deps.append(package_name)
except Exception as e:
print(f" β οΈ {package_name} - Import warning: {str(e)[:50]}...")
if missing_deps:
print(f"\nβ οΈ Missing dependencies: {', '.join(missing_deps)}")
print("Please install them using:")
print(" pip install -r requirements.txt")
return False
print("β
All dependencies are available!")
return True
def show_options():
"""Show available demo options"""
print("\nπ― HACKATHON DEMO OPTIONS:")
print()
print("1. π Interactive Gradio Web Interface (Recommended)")
print(" - Full agentic demo with real-time feedback")
print(" - Visual simulation results")
print(" - Downloadable design specifications")
print()
print("2. π₯οΈ System Demonstration & Feature Overview")
print(" - Comprehensive feature walkthrough")
print(" - Technical implementation details")
print(" - Hackathon judging criteria alignment")
print()
print("3. π Documentation & README Preview")
print(" - View generated README content")
print(" - Submission materials overview")
print()
def launch_gradio_demo():
"""Launch the main Gradio interface"""
print("π Launching Interactive Gradio Demo...")
print("This will start the web interface where you can:")
print(" β’ Select vehicle type (robot/drone)")
print(" β’ Describe your design task in natural language")
print(" β’ Watch the LLM agent work in real-time")
print(" β’ See physics simulation results")
print(" β’ Download design specifications")
print()
try:
from main_orchestrator import create_hackathon_gradio_interface
print("Creating interface...")
interface = create_hackathon_gradio_interface()
print("β
Interface created successfully!")
print()
print("π Starting web server...")
print("π The demo will open in your browser automatically")
print("π URL: http://localhost:7860")
print()
print("π‘ TIP: Try these example tasks:")
print(" β’ 'Design a robot that crosses quickly and stops safely'")
print(" β’ 'Create a drone that flies over and lands gently'")
print(" β’ 'Build a stable robot for rough terrain'")
print()
print("β οΈ Press Ctrl+C to stop the server")
print()
# Launch with browser opening
interface.launch(
server_name="0.0.0.0",
server_port=7860,
share=False, # Set to True for public sharing
show_error=True,
inbrowser=True,
quiet=False
)
except Exception as e:
print(f"β Error launching Gradio demo: {e}")
print("Please check your installation and try again.")
return False
return True
def run_system_demo():
"""Run the comprehensive system demonstration"""
print("π₯οΈ Running System Demonstration...")
print()
try:
from hackathon_demo import main
main()
except Exception as e:
print(f"β Error running system demo: {e}")
return False
return True
def show_readme():
"""Display README content"""
print("π README & Documentation Preview...")
print()
try:
with open('README.md', 'r', encoding='utf-8') as f:
content = f.read()
# Show first part of README
lines = content.split('\n')
preview_lines = lines[:50] # Show first 50 lines
for line in preview_lines:
print(line)
if len(lines) > 50:
print("\n... (README continues - see README.md for full content)")
print(f"\nπ Full README available in: README.md")
print(f"π Total README length: {len(lines)} lines")
except Exception as e:
print(f"β Error reading README: {e}")
return False
return True
def main():
"""Main launcher function"""
print_banner()
# Check dependencies first
if not check_dependencies():
print("\nβ Cannot proceed without required dependencies.")
sys.exit(1)
# Show options
show_options()
while True:
try:
print("\n" + "β" * 60)
choice = input("Enter your choice (1-3, or 'q' to quit): ").strip().lower()
if choice in ['q', 'quit', 'exit']:
print("π Thank you for exploring our hackathon submission!")
break
elif choice == '1':
if launch_gradio_demo():
break # Exit after Gradio demo ends
elif choice == '2':
run_system_demo()
elif choice == '3':
show_readme()
else:
print("β Invalid choice. Please enter 1, 2, 3, or 'q'.")
except KeyboardInterrupt:
print("\n\nπ Demo interrupted. Thank you for exploring our submission!")
break
except Exception as e:
print(f"\nβ Unexpected error: {e}")
print("Please try again or contact the developers.")
if __name__ == "__main__":
main() |