File size: 809 Bytes
ad1fdc5
 
 
 
 
 
 
 
 
 
 
689050e
ad1fdc5
 
 
 
 
 
 
 
 
59876a8
ad1fdc5
 
 
 
 
 
 
 
 
59876a8
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

try:
    from openenv.core.env_server.http_server import create_app
except Exception as e:
    raise ImportError(
        "openenv-core is required. Install with: pip install openenv-core"
    ) from e

try:
    from ..models import SQLArenaAction, SQLArenaObservation
    from .sql_arena_environment import SQLArenaEnvironment
except ImportError:
    from models import SQLArenaAction, SQLArenaObservation
    from server.sql_arena_environment import SQLArenaEnvironment


app = create_app(
    SQLArenaEnvironment,
    SQLArenaAction,
    SQLArenaObservation,
    env_name="sql_arena_env",
    max_concurrent_envs=4,  # allow parallel graders to run
)


def main(host: str = "0.0.0.0", port: int = 8000):
    import uvicorn
    uvicorn.run(app, host=host, port=port)


if __name__ == "__main__":
    main()