File size: 1,119 Bytes
1a7d583
85d3b29
 
1a7d583
85d3b29
1a7d583
85d3b29
 
 
 
 
 
 
 
 
 
 
 
 
1a7d583
85d3b29
 
1a7d583
85d3b29
 
 
1a7d583
 
 
 
85d3b29
 
 
1a7d583
85d3b29
 
 
 
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 os, sys

now_dir = os.getcwd()
sys.path.append(now_dir)

from core import run_model_information_script
from assets.i18n.i18n import I18nAuto

i18n = I18nAuto()

import gradio as gr


def processing():
    with gr.Accordion(label=i18n("View model information")):
        with gr.Row():
            with gr.Column():
                model_view_model_path = gr.Textbox(
                    label=i18n("Path to Model"),
                    info=i18n("Introduce the model pth path"),
                    value="",
                    interactive=True,
                    placeholder=i18n("Enter path to model"),
                )

        model_view_output_info = gr.Textbox(
            label=i18n("Output Information"),
            info=i18n("The output information will be displayed here."),
            value="",
            max_lines=8,
        )
        model_view_button = gr.Button(i18n("View"), variant="primary")
        model_view_button.click(
            run_model_information_script,
            [model_view_model_path],
            model_view_output_info,
            api_name="model_info",
        )