File size: 1,388 Bytes
1c2f068
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import os
import argparse
from app import iface

def main():
    parser = argparse.ArgumentParser(description='Deploy Math Misconception Predictor')
    parser.add_argument('--host', type=str, default='0.0.0.0', help='Host to bind to')
    parser.add_argument('--port', type=int, default=7860, help='Port to bind to')
    parser.add_argument('--share', action='store_true', default=True, help='Create public link')
    parser.add_argument('--debug', action='store_true', default=False, help='Enable debug mode')
    parser.add_argument('--ssl-keyfile', type=str, help='SSL key file for HTTPS')
    parser.add_argument('--ssl-certfile', type=str, help='SSL certificate file for HTTPS')
    
    args = parser.parse_args()
    
    print(f"Starting Math Misconception Predictor...")
    print(f"Host: {args.host}")
    print(f"Port: {args.port}")
    print(f"Public Link: {'Yes' if args.share else 'No'}")
    print(f"Debug Mode: {'Yes' if args.debug else 'No'}")
    
    # Launch the app
    iface.launch(
        server_name=args.host,
        server_port=args.port,
        share=args.share,
        debug=args.debug,
        show_error=True,
        ssl_keyfile=args.ssl_keyfile,
        ssl_certfile=args.ssl_certfile,
        auth=None,  
        auth_message="Welcome to Math Misconception Predictor!"
    )

if __name__ == "__main__":
    main()