Spaces:
Sleeping
Sleeping
Update app.py
Browse files59 unmodified lines606162636364656619 unmodified lines8687888989909192139 unmodified lines23223323423523523623723823823924024159 unmodified lines model="gpt-4o-mini", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": f"{instructions}\n\nText: {context}\n\nQuestions:\n"} {"role": "user", "content": f"{instructions}\n\nText: {context}\n\nQuestion:\n"} ] ) # Extract question text from the response19 unmodified lines model="gpt-4o-mini", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": f"{instructions}\n\nText: {row.context}\n\nQuestions:\n{row.questions}\n\nAnswers:\n"} {"role": "user", "content": f"{instructions}\n\nText: {row.context}\n\nQuestion:\n{row.questions}\n\nAnswer:\n"} ] ) # Extract answer text from the response139 unmodified lines df = pd.DataFrame(textify_output) df.columns = ['context'] question_protocol = "Write questions based on the text" question_protocol = "Write a question based on the text" df['questions'] = df.apply(lambda row: get_questions(row['context'], question_protocol), axis=1) answer_protocol = "Write answers based on the text" answer_protocol = "Write an answer based on the text" df['answers'] = df.apply(lambda row: get_answers(row, answer_protocol), axis=1) df = df.drop('context', axis=1)app.py+4-4