mikhiel39 commited on
Commit
1e171ca
·
verified ·
1 Parent(s): 98d7ff2

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. server/app.py +12 -9
server/app.py CHANGED
@@ -1,14 +1,18 @@
1
- from openenv.core.env_server import create_fastapi_app
2
-
3
- # 1. Import models from the root folder
4
  from models import ContractValidationAction, ContractValidationObservation
 
 
5
 
6
- # 2. Explicitly import the environment class from the "server" folder
7
- from server.contract_validation_environment import ContractValidationEnvironment
 
 
 
 
 
8
 
9
- # Let OpenEnv dynamically generate the FastAPI application for you.
10
- # NOTICE: We pass ContractValidationEnvironment directly, without ()
11
- app = create_fastapi_app(
12
  ContractValidationEnvironment,
13
  ContractValidationAction,
14
  ContractValidationObservation
@@ -18,7 +22,6 @@ app = create_fastapi_app(
18
  def main():
19
  """Entry point required by OpenEnv multi-mode deployment."""
20
  import uvicorn
21
- # Tell Uvicorn to look inside the server folder for the app
22
  uvicorn.run("server.app:app", host="0.0.0.0", port=8000, reload=True)
23
 
24
 
 
1
+ from server.contract_validation_environment import ContractValidationEnvironment
 
 
2
  from models import ContractValidationAction, ContractValidationObservation
3
+ from openenv.core.env_server import create_app
4
+ import os
5
 
6
+ # 1. FORCE the web interface to turn on before OpenEnv loads
7
+ os.environ["ENABLE_WEB_INTERFACE"] = "true"
8
+
9
+
10
+ # 2. Import models from the root folder
11
+
12
+ # 3. Explicitly import the environment class
13
 
14
+ # 4. Use create_app (This builds BOTH the backend API and the Gradio frontend)
15
+ app = create_app(
 
16
  ContractValidationEnvironment,
17
  ContractValidationAction,
18
  ContractValidationObservation
 
22
  def main():
23
  """Entry point required by OpenEnv multi-mode deployment."""
24
  import uvicorn
 
25
  uvicorn.run("server.app:app", host="0.0.0.0", port=8000, reload=True)
26
 
27