Update app.py
Browse files
app.py
CHANGED
@@ -44,28 +44,22 @@ def generate_text(input_text, selected_model):
|
|
44 |
with gr.Blocks() as demo:
|
45 |
gr.Markdown("## GPT4All Text Generation Experiment")
|
46 |
|
47 |
-
# Dropdown to select model
|
48 |
model_selection = gr.Dropdown(choices=model_choices(),
|
49 |
multiselect=False,
|
50 |
label="LLMs to choose from",
|
51 |
type="value",
|
52 |
value="orca-mini-3b-gguf2-q4_0.gguf")
|
53 |
|
54 |
-
|
55 |
-
explanation = gr.Textbox(label="Model Description", lines=10, interactive=False, value="Model description displayed here")
|
56 |
|
57 |
# Link the dropdown with the textbox to update the description based on the selected model
|
58 |
model_selection.change(fn=llm_intro, inputs=model_selection, outputs=explanation)
|
59 |
|
60 |
-
# Input text for generating text
|
61 |
input_text = gr.Textbox(lines=10, label="Input Text")
|
62 |
-
|
63 |
-
# Textbox to display generated text
|
64 |
output_text = gr.Textbox(lines=10, label="Generated Text")
|
65 |
|
66 |
# Button to generate text
|
67 |
generate_btn = gr.Button("Generate")
|
68 |
-
|
69 |
generate_btn.click(fn=generate_text, inputs=[input_text, model_selection], outputs=output_text)
|
70 |
|
71 |
demo.launch()
|
|
|
44 |
with gr.Blocks() as demo:
|
45 |
gr.Markdown("## GPT4All Text Generation Experiment")
|
46 |
|
|
|
47 |
model_selection = gr.Dropdown(choices=model_choices(),
|
48 |
multiselect=False,
|
49 |
label="LLMs to choose from",
|
50 |
type="value",
|
51 |
value="orca-mini-3b-gguf2-q4_0.gguf")
|
52 |
|
53 |
+
explanation = gr.Textbox(label="Model Description", lines=10, interactive=False, value=llm_intro("orca-mini-3b-gguf2-q4_0.gguf"))
|
|
|
54 |
|
55 |
# Link the dropdown with the textbox to update the description based on the selected model
|
56 |
model_selection.change(fn=llm_intro, inputs=model_selection, outputs=explanation)
|
57 |
|
|
|
58 |
input_text = gr.Textbox(lines=10, label="Input Text")
|
|
|
|
|
59 |
output_text = gr.Textbox(lines=10, label="Generated Text")
|
60 |
|
61 |
# Button to generate text
|
62 |
generate_btn = gr.Button("Generate")
|
|
|
63 |
generate_btn.click(fn=generate_text, inputs=[input_text, model_selection], outputs=output_text)
|
64 |
|
65 |
demo.launch()
|