Amirizaniani commited on
Commit
8e85ee2
·
verified ·
1 Parent(s): 42b28e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -5
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
- # Generate prompts for each question
160
- prompts_list = questions_list.apply(generate_prompts)
 
161
 
162
- # Combine the questions and prompts into a DataFrame
 
 
 
 
 
 
163
  output_df = pd.DataFrame({
164
- 'Questions': questions_list,
165
- 'Generated Prompts': prompts_list
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