File size: 741 Bytes
e9bb6c3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""Main entry point for the Model Benchmark Agent."""
import os

# Disable tokenizer parallelism to avoid forking issues
os.environ["TOKENIZERS_PARALLELISM"] = "false"

#!/usr/bin/env python3
import sys
import os
from interfaces.gradio_app import launch_app

def main():
    # Check if running on HuggingFace Spaces
    is_huggingface = os.getenv("SPACE_ID") is not None
    
    # If on HuggingFace or gradio argument passed, launch Gradio
    if is_huggingface or (len(sys.argv) > 1 and sys.argv[1] == "gradio"):
        launch_app()
    else:
        print("Usage: python main.py [gradio]")
        print("Available modes:")
        print("  gradio - Launch Gradio interface")

if __name__ == "__main__":
    main()