Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -67,23 +67,22 @@ score_pipe, gemma_pipe = load_models()
|
|
67 |
|
68 |
# Input: Query text for scoring and CSV file upload for candidate reviews
|
69 |
query_input = st.text_area("Enter your query text for analysis (this does not need to be part of the CSV):")
|
70 |
-
uploaded_file = st.file_uploader("Upload Reviews CSV File (must contain a '
|
71 |
|
72 |
-
if
|
|
|
73 |
try:
|
74 |
df = pd.read_csv(uploaded_file)
|
75 |
-
if '
|
76 |
-
st.error("CSV must contain a '
|
77 |
st.stop()
|
78 |
-
candidate_docs = df['
|
79 |
except Exception as e:
|
80 |
st.error(f"Error reading CSV file: {e}")
|
81 |
st.stop()
|
82 |
else:
|
83 |
st.error("Please upload a CSV file.")
|
84 |
st.stop()
|
85 |
-
|
86 |
-
if st.button("Generate Report"):
|
87 |
if not query_input.strip():
|
88 |
st.error("Please enter a query text!")
|
89 |
else:
|
|
|
67 |
|
68 |
# Input: Query text for scoring and CSV file upload for candidate reviews
|
69 |
query_input = st.text_area("Enter your query text for analysis (this does not need to be part of the CSV):")
|
70 |
+
uploaded_file = st.file_uploader("Upload Reviews CSV File (must contain a 'reviewText' column)", type=["csv"])
|
71 |
|
72 |
+
if st.button("Generate Report"):
|
73 |
+
if uploaded_file is not None:
|
74 |
try:
|
75 |
df = pd.read_csv(uploaded_file)
|
76 |
+
if 'reviewText' not in df.columns:
|
77 |
+
st.error("CSV must contain a 'reviewText' column.")
|
78 |
st.stop()
|
79 |
+
candidate_docs = df['reviewText'].dropna().astype(str).tolist()
|
80 |
except Exception as e:
|
81 |
st.error(f"Error reading CSV file: {e}")
|
82 |
st.stop()
|
83 |
else:
|
84 |
st.error("Please upload a CSV file.")
|
85 |
st.stop()
|
|
|
|
|
86 |
if not query_input.strip():
|
87 |
st.error("Please enter a query text!")
|
88 |
else:
|