File size: 1,146 Bytes
d670799 |
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 |
#!/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() |