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