yxmauw commited on
Commit
a6327bc
·
verified ·
1 Parent(s): ed11835

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -14
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
- 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=3, 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()
 
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()