File size: 974 Bytes
7f88bdf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""Push worker changes to HF Spaces."""
import subprocess
import sys
from pathlib import Path

def main():
    worker_dir = Path(__file__).resolve().parents[1] / "apps" / "worker"
    
    # Add changes
    subprocess.run(["git", "add", "src/worker/embeddings.py", "src/worker/main.py"], 
                   cwd=worker_dir, check=False)
    
    # Commit
    result = subprocess.run(
        ["git", "commit", "-m", "Fix numpy float32 in embeddings and remove db log from exception handler"],
        cwd=worker_dir, capture_output=True, text=True
    )
    print("Commit:", result.stdout)
    print("Commit stderr:", result.stderr)
    
    # Push
    result = subprocess.run(
        ["git", "push", "origin", "main", "--force"],
        cwd=worker_dir, capture_output=True, text=True
    )
    print("Push:", result.stdout)
    print("Push stderr:", result.stderr)
    
    return result.returncode

if __name__ == "__main__":
    sys.exit(main())