File size: 874 Bytes
3a478bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import os, sys

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

import gradio as gr
from assets.i18n.i18n import I18nAuto

from core import run_model_author_script

i18n = I18nAuto()


def model_author_tab():
    model_author_name = gr.Textbox(
        label=i18n("Model Author Name"),
        info=i18n("The name that will appear in the model information."),
        placeholder=i18n("Enter your nickname"),
        interactive=True,
    )
    model_author_output_info = gr.Textbox(
        label=i18n("Output Information"),
        info=i18n("The output information will be displayed here."),
        value="",
        max_lines=1,
    )
    button = gr.Button(i18n("Set name"), variant="primary")

    button.click(
        fn=run_model_author_script,
        inputs=[model_author_name],
        outputs=[model_author_output_info],
        api_name="model_author",
    )