Spaces:
Running
Running
ZhangYuhan
commited on
Commit
·
ccbca0a
1
Parent(s):
5ff1dba
upgate server
Browse files- model/model_config.py +17 -12
- model/model_registry.py +8 -0
- serve/vote_utils.py +23 -16
model/model_config.py
CHANGED
@@ -26,6 +26,12 @@ register_model_config(
|
|
26 |
# online_model=False
|
27 |
# )
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
register_model_config(
|
30 |
model_name="latent-nerf",
|
31 |
i2s_model=False,
|
@@ -50,7 +56,6 @@ register_model_config(
|
|
50 |
online_model=False
|
51 |
)
|
52 |
|
53 |
-
|
54 |
register_model_config(
|
55 |
model_name="point-e-t",
|
56 |
i2s_model=False,
|
@@ -68,11 +73,6 @@ register_model_config(
|
|
68 |
i2s_model=False,
|
69 |
online_model=False
|
70 |
)
|
71 |
-
# register_model_config(
|
72 |
-
# model_name="prolificdreamer",
|
73 |
-
# i2s_model=False,
|
74 |
-
# online_model=False
|
75 |
-
# )
|
76 |
|
77 |
# register_model_config(
|
78 |
# model_name="dreamgaussian",
|
@@ -106,11 +106,16 @@ register_model_config(
|
|
106 |
)
|
107 |
|
108 |
register_model_config(
|
109 |
-
model_name="
|
110 |
i2s_model=True,
|
111 |
online_model=False
|
112 |
)
|
113 |
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
register_model_config(
|
116 |
model_name="point-e-i",
|
@@ -125,13 +130,13 @@ register_model_config(
|
|
125 |
)
|
126 |
|
127 |
register_model_config(
|
128 |
-
model_name="
|
129 |
i2s_model=True,
|
130 |
online_model=False
|
131 |
)
|
132 |
|
133 |
register_model_config(
|
134 |
-
model_name="
|
135 |
i2s_model=True,
|
136 |
online_model=False
|
137 |
)
|
@@ -143,13 +148,13 @@ register_model_config(
|
|
143 |
)
|
144 |
|
145 |
register_model_config(
|
146 |
-
model_name="
|
147 |
i2s_model=True,
|
148 |
online_model=False
|
149 |
)
|
150 |
|
151 |
register_model_config(
|
152 |
-
model_name="
|
153 |
i2s_model=True,
|
154 |
online_model=False
|
155 |
-
)
|
|
|
26 |
# online_model=False
|
27 |
# )
|
28 |
|
29 |
+
register_model_config(
|
30 |
+
model_name="grm-t",
|
31 |
+
i2s_model=False,
|
32 |
+
online_model=False
|
33 |
+
)
|
34 |
+
|
35 |
register_model_config(
|
36 |
model_name="latent-nerf",
|
37 |
i2s_model=False,
|
|
|
56 |
online_model=False
|
57 |
)
|
58 |
|
|
|
59 |
register_model_config(
|
60 |
model_name="point-e-t",
|
61 |
i2s_model=False,
|
|
|
73 |
i2s_model=False,
|
74 |
online_model=False
|
75 |
)
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
# register_model_config(
|
78 |
# model_name="dreamgaussian",
|
|
|
106 |
)
|
107 |
|
108 |
register_model_config(
|
109 |
+
model_name="grm-i",
|
110 |
i2s_model=True,
|
111 |
online_model=False
|
112 |
)
|
113 |
|
114 |
+
register_model_config(
|
115 |
+
model_name="openlrm",
|
116 |
+
i2s_model=True,
|
117 |
+
online_model=False
|
118 |
+
)
|
119 |
|
120 |
register_model_config(
|
121 |
model_name="point-e-i",
|
|
|
130 |
)
|
131 |
|
132 |
register_model_config(
|
133 |
+
model_name="stable-zero123",
|
134 |
i2s_model=True,
|
135 |
online_model=False
|
136 |
)
|
137 |
|
138 |
register_model_config(
|
139 |
+
model_name="syncdreamer",
|
140 |
i2s_model=True,
|
141 |
online_model=False
|
142 |
)
|
|
|
148 |
)
|
149 |
|
150 |
register_model_config(
|
151 |
+
model_name="wonder3d",
|
152 |
i2s_model=True,
|
153 |
online_model=False
|
154 |
)
|
155 |
|
156 |
register_model_config(
|
157 |
+
model_name="zero123-xl",
|
158 |
i2s_model=True,
|
159 |
online_model=False
|
160 |
+
)
|
model/model_registry.py
CHANGED
@@ -102,6 +102,14 @@ register_model_info(
|
|
102 |
"Multi-view Diffusion for 3D Generation",
|
103 |
)
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
register_model_info(
|
106 |
["point-e-t", "point-e-i"],
|
107 |
"Point·E",
|
|
|
102 |
"Multi-view Diffusion for 3D Generation",
|
103 |
)
|
104 |
|
105 |
+
|
106 |
+
register_model_info(
|
107 |
+
["grm-t", "grm-i"],
|
108 |
+
"GRM",
|
109 |
+
"https://justimyhxu.github.io/projects/grm",
|
110 |
+
"GRM: Large Gaussian Reconstruction Model for Efficient 3D Reconstruction and Generation",
|
111 |
+
)
|
112 |
+
|
113 |
register_model_info(
|
114 |
["point-e-t", "point-e-i"],
|
115 |
"Point·E",
|
serve/vote_utils.py
CHANGED
@@ -7,12 +7,19 @@ from pathlib import Path
|
|
7 |
from .utils import *
|
8 |
from .log_utils import build_logger
|
9 |
from constants import IMAGE_DIR, EVALUATE_DIMS
|
|
|
10 |
|
11 |
t2s_logger = build_logger("gradio_web_server_text2shape", "gr_web_text2shape.log") # t2s = image generation, loggers for single model direct chat
|
12 |
t2s_multi_logger = build_logger("gradio_web_server_text2shape_multi", "gr_web_text2shape_multi.log") # t2s_multi = image generation multi, loggers for side-by-side and battle
|
13 |
i2s_logger = build_logger("gradio_web_server_image2shape", "gr_web_image2shape.log") # i2s = image editing, loggers for single model direct chat
|
14 |
i2s_multi_logger = build_logger("gradio_web_server_image2shape_multi", "gr_web_image2shape_multi.log") # i2s_multi = image editing multi, loggers for side-by-side and battle
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
def vote_last_response_t2s(state, dim, vote_type, model_selector, request: gr.Request):
|
17 |
with open(get_conv_log_filename(), "a") as fout:
|
18 |
data = {
|
@@ -178,8 +185,8 @@ def leftvote_last_response_t2s_anony(
|
|
178 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
179 |
return (state0, state1) \
|
180 |
+ (disable_btn,) * 4 \
|
181 |
-
+ (gr.Markdown(f"### Model A: {state0.model_name}", visible=is_visible),
|
182 |
-
gr.Markdown(f"### Model B: {state1.model_name}", visible=is_visible))
|
183 |
|
184 |
def rightvote_last_response_t2s_anony(
|
185 |
state0, state1, model_selector0, model_selector1, dim_md, request: gr.Request
|
@@ -199,8 +206,8 @@ def rightvote_last_response_t2s_anony(
|
|
199 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
200 |
return (state0, state1) \
|
201 |
+ (disable_btn,) * 4 \
|
202 |
-
+ (gr.Markdown(f"### Model A: {state0.model_name}", visible=is_visible),
|
203 |
-
gr.Markdown(f"### Model B: {state1.model_name}", visible=is_visible))
|
204 |
|
205 |
def tievote_last_response_t2s_anony(
|
206 |
state0, state1, model_selector0, model_selector1, dim_md, request: gr.Request
|
@@ -220,8 +227,8 @@ def tievote_last_response_t2s_anony(
|
|
220 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
221 |
return (state0, state1) \
|
222 |
+ (disable_btn,) * 4 \
|
223 |
-
+ (gr.Markdown(f"### Model A: {state0.model_name}", visible=is_visible),
|
224 |
-
gr.Markdown(f"### Model B: {state1.model_name}", visible=is_visible))
|
225 |
|
226 |
def bothbad_vote_last_response_t2s_anony(
|
227 |
state0, state1, model_selector0, model_selector1, dim_md, request: gr.Request
|
@@ -241,8 +248,8 @@ def bothbad_vote_last_response_t2s_anony(
|
|
241 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
242 |
return (state0, state1) \
|
243 |
+ (disable_btn,) * 4 \
|
244 |
-
+ (gr.Markdown(f"### Model A: {state0.model_name}", visible=is_visible),
|
245 |
-
gr.Markdown(f"### Model B: {state1.model_name}", visible=is_visible))
|
246 |
|
247 |
## Image-to-Shape (i2s) Single Model Direct Chat
|
248 |
def upvote_last_response_i2s(state, model_selector, dim_md, request: gr.Request):
|
@@ -331,8 +338,8 @@ def leftvote_last_response_i2s_anony(
|
|
331 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
332 |
return (state0, state1) \
|
333 |
+ (disable_btn,) * 4 \
|
334 |
-
+ (gr.Markdown(f"### Model A: {state0.model_name}", visible=is_visible),
|
335 |
-
gr.Markdown(f"### Model B: {state1.model_name}", visible=is_visible))
|
336 |
|
337 |
|
338 |
def rightvote_last_response_i2s_anony(
|
@@ -353,8 +360,8 @@ def rightvote_last_response_i2s_anony(
|
|
353 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
354 |
return (state0, state1) \
|
355 |
+ (disable_btn,) * 4 \
|
356 |
-
+ (gr.Markdown(f"### Model A: {state0.model_name}", visible=is_visible),
|
357 |
-
gr.Markdown(f"### Model B: {state1.model_name}", visible=is_visible))
|
358 |
|
359 |
|
360 |
def tievote_last_response_i2s_anony(
|
@@ -375,8 +382,8 @@ def tievote_last_response_i2s_anony(
|
|
375 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
376 |
return (state0, state1) \
|
377 |
+ (disable_btn,) * 4 \
|
378 |
-
+ (gr.Markdown(f"### Model A: {state0.model_name}", visible=is_visible),
|
379 |
-
gr.Markdown(f"### Model B: {state1.model_name}", visible=is_visible))
|
380 |
|
381 |
|
382 |
def bothbad_vote_last_response_i2s_anony(
|
@@ -397,8 +404,8 @@ def bothbad_vote_last_response_i2s_anony(
|
|
397 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
398 |
return (state0, state1) \
|
399 |
+ (disable_btn,) * 4 \
|
400 |
-
+ (gr.Markdown(f"### Model A: {state0.model_name}", visible=is_visible),
|
401 |
-
gr.Markdown(f"### Model B: {state1.model_name}", visible=is_visible))
|
402 |
|
403 |
|
404 |
|
|
|
7 |
from .utils import *
|
8 |
from .log_utils import build_logger
|
9 |
from constants import IMAGE_DIR, EVALUATE_DIMS
|
10 |
+
from model.model_registry import model_info
|
11 |
|
12 |
t2s_logger = build_logger("gradio_web_server_text2shape", "gr_web_text2shape.log") # t2s = image generation, loggers for single model direct chat
|
13 |
t2s_multi_logger = build_logger("gradio_web_server_text2shape_multi", "gr_web_text2shape_multi.log") # t2s_multi = image generation multi, loggers for side-by-side and battle
|
14 |
i2s_logger = build_logger("gradio_web_server_image2shape", "gr_web_image2shape.log") # i2s = image editing, loggers for single model direct chat
|
15 |
i2s_multi_logger = build_logger("gradio_web_server_image2shape_multi", "gr_web_image2shape_multi.log") # i2s_multi = image editing multi, loggers for side-by-side and battle
|
16 |
|
17 |
+
def remove_suffix(name):
|
18 |
+
if name.endswith("-t") or name.endswith("-i"):
|
19 |
+
return name[:-2]
|
20 |
+
else:
|
21 |
+
return name
|
22 |
+
|
23 |
def vote_last_response_t2s(state, dim, vote_type, model_selector, request: gr.Request):
|
24 |
with open(get_conv_log_filename(), "a") as fout:
|
25 |
data = {
|
|
|
185 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
186 |
return (state0, state1) \
|
187 |
+ (disable_btn,) * 4 \
|
188 |
+
+ (gr.Markdown(f"### Model A: {model_info[state0.model_name].simple_name}", visible=is_visible),
|
189 |
+
gr.Markdown(f"### Model B: {model_info[state1.model_name].simple_name}", visible=is_visible))
|
190 |
|
191 |
def rightvote_last_response_t2s_anony(
|
192 |
state0, state1, model_selector0, model_selector1, dim_md, request: gr.Request
|
|
|
206 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
207 |
return (state0, state1) \
|
208 |
+ (disable_btn,) * 4 \
|
209 |
+
+ (gr.Markdown(f"### Model A: {model_info[state0.model_name].simple_name}", visible=is_visible),
|
210 |
+
gr.Markdown(f"### Model B: {model_info[state1.model_name].simple_name}", visible=is_visible))
|
211 |
|
212 |
def tievote_last_response_t2s_anony(
|
213 |
state0, state1, model_selector0, model_selector1, dim_md, request: gr.Request
|
|
|
227 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
228 |
return (state0, state1) \
|
229 |
+ (disable_btn,) * 4 \
|
230 |
+
+ (gr.Markdown(f"### Model A: {model_info[state0.model_name].simple_name}", visible=is_visible),
|
231 |
+
gr.Markdown(f"### Model B: {model_info[state1.model_name].simple_name}", visible=is_visible))
|
232 |
|
233 |
def bothbad_vote_last_response_t2s_anony(
|
234 |
state0, state1, model_selector0, model_selector1, dim_md, request: gr.Request
|
|
|
248 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
249 |
return (state0, state1) \
|
250 |
+ (disable_btn,) * 4 \
|
251 |
+
+ (gr.Markdown(f"### Model A: {model_info[state0.model_name].simple_name}", visible=is_visible),
|
252 |
+
gr.Markdown(f"### Model B: {model_info[state1.model_name].simple_name}", visible=is_visible))
|
253 |
|
254 |
## Image-to-Shape (i2s) Single Model Direct Chat
|
255 |
def upvote_last_response_i2s(state, model_selector, dim_md, request: gr.Request):
|
|
|
338 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
339 |
return (state0, state1) \
|
340 |
+ (disable_btn,) * 4 \
|
341 |
+
+ (gr.Markdown(f"### Model A: {model_info[state0.model_name].simple_name}", visible=is_visible),
|
342 |
+
gr.Markdown(f"### Model B: {model_info[state1.model_name].simple_name}", visible=is_visible))
|
343 |
|
344 |
|
345 |
def rightvote_last_response_i2s_anony(
|
|
|
360 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
361 |
return (state0, state1) \
|
362 |
+ (disable_btn,) * 4 \
|
363 |
+
+ (gr.Markdown(f"### Model A: {model_info[state0.model_name].simple_name}", visible=is_visible),
|
364 |
+
gr.Markdown(f"### Model B: {model_info[state1.model_name].simple_name}", visible=is_visible))
|
365 |
|
366 |
|
367 |
def tievote_last_response_i2s_anony(
|
|
|
382 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
383 |
return (state0, state1) \
|
384 |
+ (disable_btn,) * 4 \
|
385 |
+
+ (gr.Markdown(f"### Model A: {model_info[state0.model_name].simple_name}", visible=is_visible),
|
386 |
+
gr.Markdown(f"### Model B: {model_info[state1.model_name].simple_name}", visible=is_visible))
|
387 |
|
388 |
|
389 |
def bothbad_vote_last_response_i2s_anony(
|
|
|
404 |
is_visible = (state0.evaluted_dims == state1.evaluted_dims == EVALUATE_DIMS)
|
405 |
return (state0, state1) \
|
406 |
+ (disable_btn,) * 4 \
|
407 |
+
+ (gr.Markdown(f"### Model A: {model_info[state0.model_name].simple_name}", visible=is_visible),
|
408 |
+
gr.Markdown(f"### Model B: {model_info[state1.model_name].simple_name}", visible=is_visible))
|
409 |
|
410 |
|
411 |
|