Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -156,13 +156,20 @@ def process_inputs(llm, file, relevance, diversity):
|
|
156 |
# Extract the first column
|
157 |
questions_list = df.iloc[:, 0]
|
158 |
|
159 |
-
#
|
160 |
-
|
|
|
161 |
|
162 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
output_df = pd.DataFrame({
|
164 |
-
'Questions':
|
165 |
-
'Generated Prompts':
|
166 |
})
|
167 |
|
168 |
# Save the DataFrame to a new Excel file
|
|
|
156 |
# Extract the first column
|
157 |
questions_list = df.iloc[:, 0]
|
158 |
|
159 |
+
# Initialize lists to store the expanded data
|
160 |
+
expanded_questions = []
|
161 |
+
expanded_prompts = []
|
162 |
|
163 |
+
# Generate prompts for each question and expand the data
|
164 |
+
for question in questions_list:
|
165 |
+
prompts = generate_prompts(question)
|
166 |
+
expanded_questions.extend([question] * len(prompts))
|
167 |
+
expanded_prompts.extend(prompts)
|
168 |
+
|
169 |
+
# Combine the expanded data into a DataFrame
|
170 |
output_df = pd.DataFrame({
|
171 |
+
'Questions': expanded_questions,
|
172 |
+
'Generated Prompts': expanded_prompts
|
173 |
})
|
174 |
|
175 |
# Save the DataFrame to a new Excel file
|