Spaces:
Sleeping
Sleeping
fix filtering
Browse files- app/main.py +6 -3
app/main.py
CHANGED
@@ -130,12 +130,15 @@ if uploaded_file:
|
|
130 |
few_shot_examples = None
|
131 |
remaining_data = df
|
132 |
|
133 |
-
# Limit rows
|
134 |
-
num_rows_to_send = st.number_input('Select number of rows to send to OpenAI ($$)',
|
|
|
|
|
135 |
if len(remaining_data) > num_rows_to_send:
|
136 |
st.warning(f"Only the first {num_rows_to_send} rows of the remaining dataset will be sent to OpenAI to minimize costs.")
|
137 |
|
138 |
-
|
|
|
139 |
|
140 |
# Prepare Few-Shot Examples for Prompting
|
141 |
example_rows = []
|
|
|
130 |
few_shot_examples = None
|
131 |
remaining_data = df
|
132 |
|
133 |
+
# Limit rows based on user input to control costs
|
134 |
+
num_rows_to_send = st.number_input('Select number of rows to send to OpenAI ($$)',
|
135 |
+
min_value=1, max_value=len(remaining_data),
|
136 |
+
value=min(20, len(remaining_data)))
|
137 |
if len(remaining_data) > num_rows_to_send:
|
138 |
st.warning(f"Only the first {num_rows_to_send} rows of the remaining dataset will be sent to OpenAI to minimize costs.")
|
139 |
|
140 |
+
# Apply the limit correctly
|
141 |
+
limited_data = remaining_data.head(num_rows_to_send)
|
142 |
|
143 |
# Prepare Few-Shot Examples for Prompting
|
144 |
example_rows = []
|