#!/usr/bin/env python3 """ Setup script for GenVidBench on Hugging Face Spaces """ import os import subprocess import sys def run_command(cmd): """Run a command and return success status""" try: result = subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True) print(f"✅ {cmd}") return True except subprocess.CalledProcessError as e: print(f"❌ {cmd}") print(f"Error: {e.stderr}") return False def main(): """Setup the environment for Hugging Face Spaces""" print("🚀 Setting up GenVidBench for Hugging Face Spaces...") # Create necessary directories os.makedirs('checkpoints', exist_ok=True) os.makedirs('tools/data/kinetics', exist_ok=True) # Download model checkpoint print("📥 Downloading model checkpoint...") if not run_command("python download_model.py"): print("⚠️ Model download failed. Please check your internet connection.") return False print("✅ Setup completed successfully!") return True if __name__ == "__main__": main()