Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -889,10 +889,13 @@ def upload_file(filepath):
|
|
889 |
vector_store1 = create_vector_store(texts1)
|
890 |
# Generate a 50-word summary from the extracted text
|
891 |
title, summary = generate_summary(texts1)
|
892 |
-
return title, summary, file_extension
|
|
|
893 |
elif file_extension == ".xlsx":
|
894 |
title, prompt = process_excel(filepath)
|
895 |
-
return title, prompt
|
|
|
|
|
896 |
|
897 |
def generate_example_questions(sheet_name, column_headers):
|
898 |
"""
|
@@ -1144,8 +1147,8 @@ def handle_large_dataset(df, create_document,isDataFrame):
|
|
1144 |
#print(df)
|
1145 |
print(f"Total rows: {total_rows}")
|
1146 |
|
1147 |
-
docstatus = f"Download the complete dataset <a href='https://huggingface.co/spaces/Redmind/NewageNXTGPT/blob/main/assets/output.xlsx' download> here.</a>.There are total of {total_rows} rows."
|
1148 |
-
|
1149 |
if total_rows < 4000:
|
1150 |
|
1151 |
# 1. Limit to first 10 rows
|
@@ -1422,9 +1425,13 @@ with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
|
|
1422 |
sample_button3.click(handle_query, [sample_button3, chatbot], [chatbot])
|
1423 |
sample_button4.click(handle_query, [sample_button4, chatbot], [chatbot])
|
1424 |
|
1425 |
-
u.upload(upload_file, u, [title_textbox, summary_textarea])
|
1426 |
u.upload(lambda _: (gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)), None, [title_textbox, summary_textarea, add_button])
|
1427 |
add_button.click(add_to_redmindgpt, [title_textbox, summary_textarea], output_message)
|
1428 |
add_button.click(lambda _: (gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)), None, [title_textbox, summary_textarea, add_button])
|
|
|
|
|
|
|
|
|
1429 |
|
1430 |
-
demo.launch(auth=[("lakshmi", "redmind"), ("arun", "redmind"), ("NewageGlobal", "Newage123$")], auth_message="RedMindGPT", inline=False)
|
|
|
889 |
vector_store1 = create_vector_store(texts1)
|
890 |
# Generate a 50-word summary from the extracted text
|
891 |
title, summary = generate_summary(texts1)
|
892 |
+
#return title, summary, file_extension
|
893 |
+
success_msg = add_to_redmindgpt(title, summary)
|
894 |
elif file_extension == ".xlsx":
|
895 |
title, prompt = process_excel(filepath)
|
896 |
+
#return title, prompt
|
897 |
+
success_msg = add_to_redmindgpt(title, prompt)
|
898 |
+
return success_msg
|
899 |
|
900 |
def generate_example_questions(sheet_name, column_headers):
|
901 |
"""
|
|
|
1147 |
#print(df)
|
1148 |
print(f"Total rows: {total_rows}")
|
1149 |
|
1150 |
+
#docstatus = f"Download the complete dataset <a href='https://huggingface.co/spaces/Redmind/NewageNXTGPT/blob/main/assets/output.xlsx' download> here.</a>.There are total of {total_rows} rows."
|
1151 |
+
docstatus = f"Download the complete dataset <a href='https://redmindtechnologies.com/RedMindGPT/output.zip' download> here.</a>.There are total of {total_rows} rows."
|
1152 |
if total_rows < 4000:
|
1153 |
|
1154 |
# 1. Limit to first 10 rows
|
|
|
1425 |
sample_button3.click(handle_query, [sample_button3, chatbot], [chatbot])
|
1426 |
sample_button4.click(handle_query, [sample_button4, chatbot], [chatbot])
|
1427 |
|
1428 |
+
"""u.upload(upload_file, u, [title_textbox, summary_textarea])
|
1429 |
u.upload(lambda _: (gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)), None, [title_textbox, summary_textarea, add_button])
|
1430 |
add_button.click(add_to_redmindgpt, [title_textbox, summary_textarea], output_message)
|
1431 |
add_button.click(lambda _: (gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)), None, [title_textbox, summary_textarea, add_button])
|
1432 |
+
"""
|
1433 |
+
u.upload(upload_file, u, output_message)
|
1434 |
+
u.upload(lambda _: (gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)), None, [title_textbox, summary_textarea, add_button])
|
1435 |
+
|
1436 |
|
1437 |
+
demo.launch(auth=[("lakshmi", "redmind"), ("admin", "redmind"), ("arun", "redmind"), ("NewageGlobal", "Newage123$")], auth_message="RedMindGPT", inline=False)
|