removed model choice
Browse files- src/app.py +4 -1
- src/utils.py +1 -1
src/app.py
CHANGED
@@ -21,6 +21,7 @@ with gr.Blocks(gr.themes.Soft(primary_hue=gr.themes.colors.slate, secondary_hue=
|
|
21 |
vector_index_btn.click(upload_and_create_vector_store, inputs=[files], outputs=vector_index_msg_out)
|
22 |
|
23 |
with gr.Column(scale=1, variant = 'panel'):
|
|
|
24 |
with gr.Row(equal_height=True):
|
25 |
|
26 |
with gr.Column(scale=1):
|
@@ -30,6 +31,7 @@ with gr.Blocks(gr.themes.Soft(primary_hue=gr.themes.colors.slate, secondary_hue=
|
|
30 |
with gr.Column(scale=1):
|
31 |
model_load_btn = gr.Button('Load model', variant='primary',scale=2)
|
32 |
load_success_msg = gr.Textbox(show_label=False,lines=1, placeholder="Model loading ...")
|
|
|
33 |
chatbot = gr.Chatbot([], elem_id="chatbot",
|
34 |
label='Chatbox', height=725, )
|
35 |
|
@@ -43,7 +45,7 @@ with gr.Blocks(gr.themes.Soft(primary_hue=gr.themes.colors.slate, secondary_hue=
|
|
43 |
with gr.Column(scale=1):
|
44 |
clear_btn = gr.Button('Clear',variant='stop',size = 'sm')
|
45 |
|
46 |
-
model_load_btn.click(load_models, [llm], load_success_msg, api_name="load_models")
|
47 |
|
48 |
txt.submit(add_text, [chatbot, txt], [chatbot, txt]).then(
|
49 |
bot, [chatbot,instruction,temperature,max_new_tokens,k_context], chatbot)
|
@@ -56,4 +58,5 @@ with gr.Blocks(gr.themes.Soft(primary_hue=gr.themes.colors.slate, secondary_hue=
|
|
56 |
|
57 |
if __name__ == '__main__':
|
58 |
# demo.queue(concurrency_count=3)
|
|
|
59 |
demo.launch(server_name="0.0.0.0", server_port=7860, show_api=False)
|
|
|
21 |
vector_index_btn.click(upload_and_create_vector_store, inputs=[files], outputs=vector_index_msg_out)
|
22 |
|
23 |
with gr.Column(scale=1, variant = 'panel'):
|
24 |
+
"""
|
25 |
with gr.Row(equal_height=True):
|
26 |
|
27 |
with gr.Column(scale=1):
|
|
|
31 |
with gr.Column(scale=1):
|
32 |
model_load_btn = gr.Button('Load model', variant='primary',scale=2)
|
33 |
load_success_msg = gr.Textbox(show_label=False,lines=1, placeholder="Model loading ...")
|
34 |
+
"""
|
35 |
chatbot = gr.Chatbot([], elem_id="chatbot",
|
36 |
label='Chatbox', height=725, )
|
37 |
|
|
|
45 |
with gr.Column(scale=1):
|
46 |
clear_btn = gr.Button('Clear',variant='stop',size = 'sm')
|
47 |
|
48 |
+
#model_load_btn.click(load_models, [llm], load_success_msg, api_name="load_models")
|
49 |
|
50 |
txt.submit(add_text, [chatbot, txt], [chatbot, txt]).then(
|
51 |
bot, [chatbot,instruction,temperature,max_new_tokens,k_context], chatbot)
|
|
|
58 |
|
59 |
if __name__ == '__main__':
|
60 |
# demo.queue(concurrency_count=3)
|
61 |
+
load_models()
|
62 |
demo.launch(server_name="0.0.0.0", server_port=7860, show_api=False)
|
src/utils.py
CHANGED
@@ -4,7 +4,7 @@ from vector_index import *
|
|
4 |
from setup import ModelSetup
|
5 |
import json
|
6 |
|
7 |
-
def load_models(model_name):
|
8 |
global conv_qa
|
9 |
conv_qa = Conversation_RAG(model_name)
|
10 |
global model_setup
|
|
|
4 |
from setup import ModelSetup
|
5 |
import json
|
6 |
|
7 |
+
def load_models(model_name="gpt-3.5-turbo"):
|
8 |
global conv_qa
|
9 |
conv_qa = Conversation_RAG(model_name)
|
10 |
global model_setup
|