File size: 625 Bytes
2de3774
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
from modules.llama_pipeline import run_llama, llama_names
from pathlib import Path

def add_llama_tab(prompt):
    def run_llama_run(system_file, prompt):
        res = run_llama(system_file, prompt)

        return gr.update(value=res)

    

    with gr.Group(), gr.Row():
        llama_select = gr.Dropdown(
            choices=llama_names(),
            show_label=False,
            scale=4,
        )
        llama_btn = gr.Button(
            value="🦙",
            scale=1,
            min_width=1,
        )

    llama_btn.click(run_llama_run, inputs=[llama_select, prompt], outputs=[prompt])