matthoffner commited on
Commit
f0b6d3b
Β·
1 Parent(s): 84c9a13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -22
app.py CHANGED
@@ -28,28 +28,6 @@ with gr.Blocks() as demo:
28
  with gr.Column(min_width=30, scale=1):
29
  index_refresh_btn = gr.Button("πŸ”„").style()
30
 
31
- with gr.Tab("Upload"):
32
- with gr.Row():
33
- with gr.Column():
34
- index_type = gr.Dropdown(choices=["GPTVectorStoreIndex"], label="index_type", value="GPTVectorStoreIndex")
35
- upload_file = gr.Files(label="upload_file .txt, .pdf, .epub")
36
- new_index_name = gr.Textbox(placeholder="new_index_name: ", show_label=False).style(container=False)
37
- construct_btn = gr.Button("βš’οΈ Index", variant="primary")
38
- with gr.Row():
39
- with gr.Column():
40
- with gr.Row():
41
- max_input_size = gr.Slider(256, 4096, 4096, step=1, label="max_input_size", interactive=True, show_label=True)
42
- num_outputs = gr.Slider(256, 4096, 512, step=1, label="num_outputs", interactive=True, show_label=True)
43
- with gr.Row():
44
- max_chunk_overlap = gr.Slider(0, 100, 20, step=1, label="max_chunk_overlap", interactive=True, show_label=True)
45
- chunk_size_limit = gr.Slider(0, 4096, 0, step=1, label="chunk_size_limit", interactive=True, show_label=True)
46
- with gr.Row():
47
- embedding_limit = gr.Slider(0, 100, 0, step=1, label="embedding_limit", interactive=True, show_label=True)
48
- separator = gr.Textbox(show_label=False, label="separator", placeholder=",", value="", interactive=True)
49
- with gr.Row():
50
- num_children = gr.Slider(2, 100, 10, step=1, label="num_children", interactive=False, show_label=True)
51
- max_keywords_per_chunk = gr.Slider(1, 100, 10, step=1, label="max_keywords_per_chunk", interactive=False, show_label=True)
52
-
53
  with gr.Tab("Search"):
54
  with gr.Row():
55
  with gr.Column(scale=1):
@@ -79,6 +57,29 @@ with gr.Blocks() as demo:
79
  refine_tmpl = gr.Textbox(value=refine_tmpl_dict["Default"] ,lines=10, max_lines=40 ,show_label=False)
80
 
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  chat_input.submit(chat_ai, [index_select, chat_input, prompt_tmpl, refine_tmpl, sim_k, chat_tone, chat_context, chatbot, search_options_checkbox], [chat_context, chatbot])
83
  chat_input.submit(reset_textbox, [], [chat_input])
84
  chat_submit_btn.click(chat_ai, [index_select, chat_input, prompt_tmpl, refine_tmpl, sim_k, chat_tone, chat_context, chatbot, search_options_checkbox], [chat_context, chatbot])
 
28
  with gr.Column(min_width=30, scale=1):
29
  index_refresh_btn = gr.Button("πŸ”„").style()
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  with gr.Tab("Search"):
32
  with gr.Row():
33
  with gr.Column(scale=1):
 
57
  refine_tmpl = gr.Textbox(value=refine_tmpl_dict["Default"] ,lines=10, max_lines=40 ,show_label=False)
58
 
59
 
60
+ with gr.Tab("Upload"):
61
+ with gr.Row():
62
+ with gr.Column():
63
+ index_type = gr.Dropdown(choices=["GPTVectorStoreIndex"], label="index_type", value="GPTVectorStoreIndex")
64
+ upload_file = gr.Files(label="upload_file .txt, .pdf, .epub")
65
+ new_index_name = gr.Textbox(placeholder="new_index_name: ", show_label=False).style(container=False)
66
+ construct_btn = gr.Button("βš’οΈ Index", variant="primary")
67
+ with gr.Row():
68
+ with gr.Column():
69
+ with gr.Row():
70
+ max_input_size = gr.Slider(256, 4096, 4096, step=1, label="max_input_size", interactive=True, show_label=True)
71
+ num_outputs = gr.Slider(256, 4096, 512, step=1, label="num_outputs", interactive=True, show_label=True)
72
+ with gr.Row():
73
+ max_chunk_overlap = gr.Slider(0, 100, 20, step=1, label="max_chunk_overlap", interactive=True, show_label=True)
74
+ chunk_size_limit = gr.Slider(0, 4096, 0, step=1, label="chunk_size_limit", interactive=True, show_label=True)
75
+ with gr.Row():
76
+ embedding_limit = gr.Slider(0, 100, 0, step=1, label="embedding_limit", interactive=True, show_label=True)
77
+ separator = gr.Textbox(show_label=False, label="separator", placeholder=",", value="", interactive=True)
78
+ with gr.Row():
79
+ num_children = gr.Slider(2, 100, 10, step=1, label="num_children", interactive=False, show_label=True)
80
+ max_keywords_per_chunk = gr.Slider(1, 100, 10, step=1, label="max_keywords_per_chunk", interactive=False, show_label=True)
81
+
82
+
83
  chat_input.submit(chat_ai, [index_select, chat_input, prompt_tmpl, refine_tmpl, sim_k, chat_tone, chat_context, chatbot, search_options_checkbox], [chat_context, chatbot])
84
  chat_input.submit(reset_textbox, [], [chat_input])
85
  chat_submit_btn.click(chat_ai, [index_select, chat_input, prompt_tmpl, refine_tmpl, sim_k, chat_tone, chat_context, chatbot, search_options_checkbox], [chat_context, chatbot])