Update app.py
Browse files
app.py
CHANGED
@@ -44,32 +44,8 @@ def generate_text(input_text, selected_model):
|
|
44 |
output = model.generate(input_text, max_tokens=100)
|
45 |
return output
|
46 |
|
47 |
-
|
48 |
-
# with gr.Blocks() as demo:
|
49 |
-
# gr.Markdown("## GPT4All Text Generation Experiment")
|
50 |
-
|
51 |
-
# with gr.Row():
|
52 |
-
|
53 |
-
|
54 |
-
# model_selection = gr.Dropdown(choices=model_choices(),
|
55 |
-
# multiselect=False,
|
56 |
-
# label="LLMs to choose from",
|
57 |
-
# type="value",
|
58 |
-
# value="orca-mini-3b-gguf2-q4_0.gguf")
|
59 |
-
|
60 |
-
# explanation = gr.Textbox(label="Model Description", lines=3, interactive=False, value=llm_intro("orca-mini-3b-gguf2-q4_0.gguf"))
|
61 |
-
|
62 |
-
# # Link the dropdown with the textbox to update the description based on the selected model
|
63 |
-
# model_selection.change(fn=llm_intro, inputs=model_selection, outputs=explanation)
|
64 |
-
|
65 |
-
# chatbot = gr.Chatbot()
|
66 |
-
# input_text = gr.Textbox(lines=3, label="Press shift+Enter to submit")
|
67 |
-
# # output_text = gr.Textbox(lines=10, label="Generated Text")
|
68 |
# clear = gr.ClearButton([input_text, chatbot])
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
# Define the chatbot function
|
74 |
def generate_response(model_name, message, chat_history):
|
75 |
model = load_model(model_name)
|
@@ -101,7 +77,7 @@ with gr.Blocks() as demo:
|
|
101 |
model_dropdown.change(fn=llm_intro, inputs=model_dropdown, outputs=explanation)
|
102 |
|
103 |
with gr.Column(scale=4):
|
104 |
-
chatbot = gr.Chatbot(label="
|
105 |
|
106 |
message = gr.Textbox(label="Message")
|
107 |
state = gr.State()
|
|
|
44 |
output = model.generate(input_text, max_tokens=100)
|
45 |
return output
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
# clear = gr.ClearButton([input_text, chatbot])
|
48 |
|
|
|
|
|
|
|
49 |
# Define the chatbot function
|
50 |
def generate_response(model_name, message, chat_history):
|
51 |
model = load_model(model_name)
|
|
|
77 |
model_dropdown.change(fn=llm_intro, inputs=model_dropdown, outputs=explanation)
|
78 |
|
79 |
with gr.Column(scale=4):
|
80 |
+
chatbot = gr.Chatbot(label="Chatroom", value=[(None, "How may I help you today?")])
|
81 |
|
82 |
message = gr.Textbox(label="Message")
|
83 |
state = gr.State()
|