|
|
|
|
|
"""
|
|
|
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...")
|
|
|
|
|
|
|
|
|
os.makedirs('checkpoints', exist_ok=True)
|
|
|
os.makedirs('tools/data/kinetics', exist_ok=True)
|
|
|
|
|
|
|
|
|
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() |