Spaces:
Runtime error
Runtime error
Chintan Donda
commited on
Commit
·
514719c
1
Parent(s):
227ccaf
Updating Load Custom Data widget
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ class DomState:
|
|
33 |
self.weather_forecast = ''
|
34 |
self.weather_forecast_summary = ''
|
35 |
self.indic_translation = ''
|
36 |
-
self.kb_sources =
|
37 |
|
38 |
# Initialize index (vector store) - This will create a new index from scratch if load_from_existing_index_file == False
|
39 |
self.kkms_kssw_obj = kkms_kssw.KKMS_KSSW()
|
@@ -336,7 +336,9 @@ with gr.Blocks(title='KKMS-Smart-Search-Demo') as demo:
|
|
336 |
with gr.Tab(label='Relevant paragraphs'):
|
337 |
question_category = gr.Dropdown(
|
338 |
constants_utils.INDEX_CATEGORY,
|
339 |
-
label="Select Question Category"
|
|
|
|
|
340 |
question = gr.Textbox(label="Enter your question", placeholder='Type the question here')
|
341 |
# Get the Relevant paragraphs for the question asked
|
342 |
relevant_paragraphs = gr.Textbox(label="Relevant paragraphs are:", value=dom.relevant_paragraphs, interactive=False)
|
@@ -373,7 +375,9 @@ with gr.Blocks(title='KKMS-Smart-Search-Demo') as demo:
|
|
373 |
# Select the language
|
374 |
language = gr.Dropdown(
|
375 |
list(constants_utils.INDIC_LANGUAGE.keys()),
|
376 |
-
label="Select language"
|
|
|
|
|
377 |
indic_lang_answer = gr.Textbox(label="Answer in the selected language is:", interactive=False)
|
378 |
answer.change(
|
379 |
dom.click_handler_for_get_indic_translation,
|
@@ -404,7 +408,11 @@ with gr.Blocks(title='KKMS-Smart-Search-Demo') as demo:
|
|
404 |
with gr.Row(visible=False) as rowMandiPrice:
|
405 |
with gr.Column(scale=1, min_width=600):
|
406 |
# Select State
|
407 |
-
state_name = gr.Dropdown(
|
|
|
|
|
|
|
|
|
408 |
# APMC name
|
409 |
apmc_name = gr.Textbox(label="Enter APMC name", placeholder='Type the APMC name here')
|
410 |
# APMC name
|
@@ -429,7 +437,8 @@ with gr.Blocks(title='KKMS-Smart-Search-Demo') as demo:
|
|
429 |
# Select the State
|
430 |
state = gr.Dropdown(
|
431 |
list(constants_utils.WEATHER_FORECAST_STATE_CODES.keys()),
|
432 |
-
label="Select state"
|
|
|
433 |
)
|
434 |
|
435 |
# Select District
|
@@ -469,7 +478,9 @@ with gr.Blocks(title='KKMS-Smart-Search-Demo') as demo:
|
|
469 |
# Select the language
|
470 |
language = gr.Dropdown(
|
471 |
list(constants_utils.INDIC_LANGUAGE.keys()),
|
472 |
-
label="Select language"
|
|
|
|
|
473 |
indic_weather_forecast_summary = gr.Textbox(label="Weather Forecast Summary in the selected language is:", interactive=False)
|
474 |
|
475 |
# By default display weather forecast summary in Hindi. User can change it later on.
|
@@ -500,7 +511,9 @@ with gr.Blocks(title='KKMS-Smart-Search-Demo') as demo:
|
|
500 |
with gr.Tab(label='Load Custom Data (Do not upload data from the same file/url again. Once it is uploaded, it gets stored forever.)'):
|
501 |
question_category = gr.Dropdown(
|
502 |
constants_utils.INDEX_CATEGORY,
|
503 |
-
label="Select Query Type"
|
|
|
|
|
504 |
|
505 |
doc_type = gr.Radio(
|
506 |
list(constants_utils.DATA_SOURCES.keys()),
|
|
|
33 |
self.weather_forecast = ''
|
34 |
self.weather_forecast_summary = ''
|
35 |
self.indic_translation = ''
|
36 |
+
self.kb_sources = ''
|
37 |
|
38 |
# Initialize index (vector store) - This will create a new index from scratch if load_from_existing_index_file == False
|
39 |
self.kkms_kssw_obj = kkms_kssw.KKMS_KSSW()
|
|
|
336 |
with gr.Tab(label='Relevant paragraphs'):
|
337 |
question_category = gr.Dropdown(
|
338 |
constants_utils.INDEX_CATEGORY,
|
339 |
+
label="Select Question Category",
|
340 |
+
value=constants_utils.INDEX_CATEGORY[0]
|
341 |
+
)
|
342 |
question = gr.Textbox(label="Enter your question", placeholder='Type the question here')
|
343 |
# Get the Relevant paragraphs for the question asked
|
344 |
relevant_paragraphs = gr.Textbox(label="Relevant paragraphs are:", value=dom.relevant_paragraphs, interactive=False)
|
|
|
375 |
# Select the language
|
376 |
language = gr.Dropdown(
|
377 |
list(constants_utils.INDIC_LANGUAGE.keys()),
|
378 |
+
label="Select language",
|
379 |
+
value=list(constants_utils.INDIC_LANGUAGE.keys())[0]
|
380 |
+
)
|
381 |
indic_lang_answer = gr.Textbox(label="Answer in the selected language is:", interactive=False)
|
382 |
answer.change(
|
383 |
dom.click_handler_for_get_indic_translation,
|
|
|
408 |
with gr.Row(visible=False) as rowMandiPrice:
|
409 |
with gr.Column(scale=1, min_width=600):
|
410 |
# Select State
|
411 |
+
state_name = gr.Dropdown(
|
412 |
+
constants_utils.MANDI_PRICE_STATES,
|
413 |
+
label="Select state",
|
414 |
+
value=constants_utils.MANDI_PRICE_STATES[0]
|
415 |
+
)
|
416 |
# APMC name
|
417 |
apmc_name = gr.Textbox(label="Enter APMC name", placeholder='Type the APMC name here')
|
418 |
# APMC name
|
|
|
437 |
# Select the State
|
438 |
state = gr.Dropdown(
|
439 |
list(constants_utils.WEATHER_FORECAST_STATE_CODES.keys()),
|
440 |
+
label="Select state",
|
441 |
+
value=list(constants_utils.WEATHER_FORECAST_STATE_CODES.keys())[0]
|
442 |
)
|
443 |
|
444 |
# Select District
|
|
|
478 |
# Select the language
|
479 |
language = gr.Dropdown(
|
480 |
list(constants_utils.INDIC_LANGUAGE.keys()),
|
481 |
+
label="Select language",
|
482 |
+
value=list(constants_utils.INDIC_LANGUAGE.keys())[0]
|
483 |
+
)
|
484 |
indic_weather_forecast_summary = gr.Textbox(label="Weather Forecast Summary in the selected language is:", interactive=False)
|
485 |
|
486 |
# By default display weather forecast summary in Hindi. User can change it later on.
|
|
|
511 |
with gr.Tab(label='Load Custom Data (Do not upload data from the same file/url again. Once it is uploaded, it gets stored forever.)'):
|
512 |
question_category = gr.Dropdown(
|
513 |
constants_utils.INDEX_CATEGORY,
|
514 |
+
label="Select Query Type",
|
515 |
+
value=constants_utils.INDEX_CATEGORY[0]
|
516 |
+
)
|
517 |
|
518 |
doc_type = gr.Radio(
|
519 |
list(constants_utils.DATA_SOURCES.keys()),
|