Spaces:
Paused
Paused
alessandro trinca tornidor
commited on
Commit
·
540a51f
1
Parent(s):
cc47f6d
feat: update markdown description displaying current model parameters
Browse files
lisa_on_cuda/utils/app_helpers.py
CHANGED
@@ -412,12 +412,18 @@ def get_gradio_interface(
|
|
412 |
fn_inference: Callable,
|
413 |
args: str = None
|
414 |
):
|
415 |
-
|
416 |
if args is not None:
|
417 |
-
|
418 |
args_dict = {arg: getattr(args, arg) for arg in vars(args)}
|
419 |
for arg_k, arg_v in args_dict.items():
|
420 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
421 |
return gr.Interface(
|
422 |
fn_inference,
|
423 |
inputs=[
|
@@ -430,8 +436,8 @@ def get_gradio_interface(
|
|
430 |
gr.Textbox(lines=1, placeholder=None, label="Text Output")
|
431 |
],
|
432 |
title=constants.title,
|
433 |
-
description=
|
434 |
-
article=
|
435 |
examples=constants.examples,
|
436 |
allow_flagging="auto"
|
437 |
)
|
|
|
412 |
fn_inference: Callable,
|
413 |
args: str = None
|
414 |
):
|
415 |
+
article_and_demo_parameters = constants.article
|
416 |
if args is not None:
|
417 |
+
article_and_demo_parameters = constants.demo_parameters
|
418 |
args_dict = {arg: getattr(args, arg) for arg in vars(args)}
|
419 |
for arg_k, arg_v in args_dict.items():
|
420 |
+
print(f"arg_k:{arg_v}, arg_v:{arg_v}.")
|
421 |
+
article_and_demo_parameters += " * " + "".join(f"{arg_k}: {arg_v};\n")
|
422 |
+
|
423 |
+
print(f"args_dict:{args_dict}.")
|
424 |
+
print(f"description_and_demo_parameters:{article_and_demo_parameters}.")
|
425 |
+
article_and_demo_parameters += "\n\n" + constants.article
|
426 |
+
|
427 |
return gr.Interface(
|
428 |
fn_inference,
|
429 |
inputs=[
|
|
|
436 |
gr.Textbox(lines=1, placeholder=None, label="Text Output")
|
437 |
],
|
438 |
title=constants.title,
|
439 |
+
description=constants.description,
|
440 |
+
article=article_and_demo_parameters,
|
441 |
examples=constants.examples,
|
442 |
allow_flagging="auto"
|
443 |
)
|
lisa_on_cuda/utils/constants.py
CHANGED
@@ -34,7 +34,9 @@ Hope you can enjoy our work!
|
|
34 |
</font>
|
35 |
"""
|
36 |
|
37 |
-
demo_parameters = """
|
|
|
|
|
38 |
|
39 |
article = """
|
40 |
<p style='text-align: center'>
|
|
|
34 |
</font>
|
35 |
"""
|
36 |
|
37 |
+
demo_parameters = """## Model configuration parameters\n
|
38 |
+
The demo uses these parameters:
|
39 |
+
"""
|
40 |
|
41 |
article = """
|
42 |
<p style='text-align: center'>
|