Spaces:
Sleeping
Sleeping
File size: 1,978 Bytes
7e5c5ea |
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 |
#!/usr/bin/env python3
"""
Simple test script to run the evaluation with the correct Python interpreter.
"""
import subprocess
import sys
import os
from pathlib import Path
def main():
# Get the Python interpreter that was used to run this script
python_exe = sys.executable
print(f"Using Python interpreter: {python_exe}")
# Change to the script directory
script_dir = Path(__file__).parent
os.chdir(script_dir)
print(f"Working directory: {script_dir}")
# Test the setup first
print("\n" + "="*50)
print("TESTING SETUP")
print("="*50)
try:
result = subprocess.run([python_exe, "test_setup.py"],
capture_output=True, text=True, timeout=30)
print("STDOUT:")
print(result.stdout)
if result.stderr:
print("STDERR:")
print(result.stderr)
print(f"Return code: {result.returncode}")
if result.returncode == 0:
print("\n✓ Setup test passed!")
else:
print("\n✗ Setup test failed!")
return
except subprocess.TimeoutExpired:
print("Setup test timed out")
return
except Exception as e:
print(f"Error running setup test: {e}")
return
# If setup test passed, try running the evaluation
print("\n" + "="*50)
print("RUNNING EVALUATION")
print("="*50)
try:
result = subprocess.run([python_exe, "deep_eval.py"],
capture_output=True, text=True, timeout=300)
print("STDOUT:")
print(result.stdout)
if result.stderr:
print("STDERR:")
print(result.stderr)
print(f"Return code: {result.returncode}")
except subprocess.TimeoutExpired:
print("Evaluation timed out")
except Exception as e:
print(f"Error running evaluation: {e}")
if __name__ == "__main__":
main() |