Spaces:
Sleeping
Sleeping
Update app.py
Browse files59 unmodified lines6061626364656619 unmodified lines86878889909192139 unmodified lines23223323423523623723823924024159 unmodified linesmodel="gpt-4o-mini",messages=[{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": f"{instructions}\n\nText: {context}\n\nQuestions:\n"}])# Extract question text from the response19 unmodified linesmodel="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"}])# Extract answer text from the response139 unmodified linesdf = pd.DataFrame(textify_output)df.columns = ['context']question_protocol = "Write questions 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"df['answers'] = df.apply(lambda row: get_answers(row, answer_protocol), axis=1)df = df.drop('context', axis=1)59 unmodified lines6061626364656619 unmodified lines86878889909192139 unmodified lines23223323423523623723823924024159 unmodified linesmodel="gpt-4o-mini",messages=[{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": f"{instructions}\n\nText: {context}\n\nQuestion:\n"}])# Extract question text from the response19 unmodified linesmodel="gpt-4o-mini",messages=[{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": f"{instructions}\n\nText: {row.context}\n\nQuestion:\n{row.questions}\n\nAnswer:\n"}])# Extract answer text from the response139 unmodified linesdf = pd.DataFrame(textify_output)df.columns = ['context']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 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