Spaces:
Running
on
Zero
Running
on
Zero
Update ssh
Browse files- app.py +11 -2
- serve/gradio_web.py +2 -7
app.py
CHANGED
@@ -4,7 +4,10 @@ from serve.gradio_web import *
|
|
4 |
from serve.leaderboard import build_leaderboard_tab
|
5 |
from model.model_manager import ModelManager
|
6 |
from pathlib import Path
|
7 |
-
from serve.constants import SERVER_PORT, ROOT_PATH, ELO_RESULTS_DIR
|
|
|
|
|
|
|
8 |
|
9 |
def build_combine_demo(models, elo_results_file, leaderboard_table_file):
|
10 |
# gr.themes.Default(),
|
@@ -49,12 +52,18 @@ def load_elo_results(elo_results_dir):
|
|
49 |
# raise ValueError(f"Unknown file name: {file.name}")
|
50 |
|
51 |
return elo_results_file, leaderboard_table_file
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
53 |
if __name__ == "__main__":
|
54 |
server_port = int(SERVER_PORT)
|
55 |
root_path = ROOT_PATH
|
56 |
elo_results_dir = ELO_RESULTS_DIR
|
57 |
models = ModelManager()
|
|
|
58 |
|
59 |
elo_results_file, leaderboard_table_file = load_elo_results(elo_results_dir)
|
60 |
demo = build_combine_demo(models, elo_results_file, leaderboard_table_file)
|
|
|
4 |
from serve.leaderboard import build_leaderboard_tab
|
5 |
from model.model_manager import ModelManager
|
6 |
from pathlib import Path
|
7 |
+
from serve.constants import SERVER_PORT, ROOT_PATH, ELO_RESULTS_DIR, SSH_SERVER, SSH_PORT, SSH_USER, SSH_PASSWORD
|
8 |
+
from serve.upload import get_random_mscoco_prompt, create_ssh_client
|
9 |
+
from serve.update_skill import create_ssh_skill_client
|
10 |
+
from model.matchmaker import create_ssh_matchmaker_client
|
11 |
|
12 |
def build_combine_demo(models, elo_results_file, leaderboard_table_file):
|
13 |
# gr.themes.Default(),
|
|
|
52 |
# raise ValueError(f"Unknown file name: {file.name}")
|
53 |
|
54 |
return elo_results_file, leaderboard_table_file
|
55 |
+
|
56 |
+
def set_ssh():
|
57 |
+
create_ssh_client(SSH_SERVER, SSH_PORT, SSH_USER, SSH_PASSWORD)
|
58 |
+
create_ssh_skill_client(SSH_SERVER, SSH_PORT, SSH_USER, SSH_PASSWORD)
|
59 |
+
create_ssh_matchmaker_client(SSH_SERVER, SSH_PORT, SSH_USER, SSH_PASSWORD)
|
60 |
+
|
61 |
if __name__ == "__main__":
|
62 |
server_port = int(SERVER_PORT)
|
63 |
root_path = ROOT_PATH
|
64 |
elo_results_dir = ELO_RESULTS_DIR
|
65 |
models = ModelManager()
|
66 |
+
set_ssh()
|
67 |
|
68 |
elo_results_file, leaderboard_table_file = load_elo_results(elo_results_dir)
|
69 |
demo = build_combine_demo(models, elo_results_file, leaderboard_table_file)
|
serve/gradio_web.py
CHANGED
@@ -33,11 +33,9 @@ from .Ksort import (
|
|
33 |
reset_vote_text,
|
34 |
text_response_rank_igm,
|
35 |
)
|
36 |
-
|
37 |
-
from .update_skill import create_ssh_skill_client
|
38 |
-
from model.matchmaker import create_ssh_matchmaker_client
|
39 |
from functools import partial
|
40 |
-
from .
|
41 |
|
42 |
def build_side_by_side_ui_anony(models):
|
43 |
notice_markdown = """
|
@@ -53,9 +51,6 @@ def build_side_by_side_ui_anony(models):
|
|
53 |
"""
|
54 |
|
55 |
model_list = models.model_ig_list
|
56 |
-
create_ssh_client(SSH_SERVER, SSH_PORT, SSH_USER, SSH_PASSWORD)
|
57 |
-
create_ssh_skill_client(SSH_SERVER, SSH_PORT, SSH_USER, SSH_PASSWORD)
|
58 |
-
create_ssh_matchmaker_client(SSH_SERVER, SSH_PORT, SSH_USER, SSH_PASSWORD)
|
59 |
|
60 |
state0 = gr.State()
|
61 |
state1 = gr.State()
|
|
|
33 |
reset_vote_text,
|
34 |
text_response_rank_igm,
|
35 |
)
|
36 |
+
|
|
|
|
|
37 |
from functools import partial
|
38 |
+
from .upload import get_random_mscoco_prompt
|
39 |
|
40 |
def build_side_by_side_ui_anony(models):
|
41 |
notice_markdown = """
|
|
|
51 |
"""
|
52 |
|
53 |
model_list = models.model_ig_list
|
|
|
|
|
|
|
54 |
|
55 |
state0 = gr.State()
|
56 |
state1 = gr.State()
|