-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo_gradio.py
39 lines (28 loc) · 1.01 KB
/
demo_gradio.py
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
import asyncio
import json
import os
import requests
import time
import tensorneko_util as N
from pathlib import Path
from dotenv import load_dotenv
load_dotenv()
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--base_config", type=str, required=True)
parser.add_argument("--model_config", type=str, required=True)
parser.add_argument("--share", default=False, action="store_true")
args = parser.parse_args()
from hydra_vl4ai.util.config import Config
Config.base_config_path = args.base_config
Config.model_config_path = args.model_config
from hydra_vl4ai.agent.webui import HydraNoRLWeb
from hydra_vl4ai.util.console import logger, console
from hydra_vl4ai.util.misc import wait_until_loaded
async def main():
with console.status("[bold green]Connect to HYDRA executor...") as status:
wait_until_loaded(f"http://localhost:{Config.base_config['executor_port']}")
hydra = HydraNoRLWeb()
hydra.gradio_app.launch(share=args.share)
if __name__ == "__main__":
asyncio.run(main())