From b25d3e43091298d0860a76fda86a8ae918f08710 Mon Sep 17 00:00:00 2001 From: "Corian (Cory) Kennedy" Date: Mon, 8 May 2023 10:26:07 -0500 Subject: [PATCH] Update sscGPT.py --- tools/sscGPT/sscGPT.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/tools/sscGPT/sscGPT.py b/tools/sscGPT/sscGPT.py index db08278..b0b6a14 100644 --- a/tools/sscGPT/sscGPT.py +++ b/tools/sscGPT/sscGPT.py @@ -306,17 +306,8 @@ def parse_html_to_text(html_content): file = st.sidebar.file_uploader("Choose a file") if file is not None: - content = file.read().decode("utf-8") - content_lines = content.split("\n") - - - - - - - - - #st.write(content) + content = file.readlines().decode("utf-8") + #content_lines = content.split("\n") sscassetlogo_col, sscassetquery_col = st.sidebar.columns([1, 10]) @@ -421,7 +412,8 @@ def parse_html_to_text(html_content): mime="text/csv", ) elif search_type == "File Upload": - for line in content_lines: + results = search_assets(query) + for line in content: line = line.strip() for chunk in line: @@ -438,7 +430,7 @@ def parse_html_to_text(html_content): textout.write("\n") with open(jsondir, "r", encoding="UTF-8") as file: json_content = file.read() - + json_button = st.download_button( label="Download JSON", data=json_content, @@ -447,7 +439,7 @@ def parse_html_to_text(html_content): ) with open(csvdir, "r", encoding="UTF-8") as file: csv_content = file.read() - + csv_button = st.download_button( label="Download CSV", data=csv_content,