Spaces:
Runtime error
Runtime error
Update app.py
Browse files3 unmodified lines45677891068 unmodified lines79808182838485868716 unmodified lines10410510610410710810911013 unmodified lines1241251261273 unmodified linesimport time
# Set your OpenAI API keyopenai.api_key = 'sk-proj-fCrObs9lnucfEFwJdMkHT3BlbkFJA7auo8szgjDuHz28QGBW'openai.api_key = 'your-openai-api-key'
def extract_text_from_pdf(pdf_file): text = ""68 unmodified lines if not text: return "No text provided for evaluation." if len(text) > 2000: return "The text provided exceeds the 2000 character limit." evaluation = evaluate_text_against_rubric(rubric, text) if isinstance(evaluation, str): # If it's an error message16 unmodified lines rubric_pdf_input = gr.File(label="Upload Rubric PDF (optional)", type="binary") rubric_text_input = gr.Textbox(lines=10, placeholder="Or enter your rubric text here...", label="Rubric Text (optional)") text_input = gr.Textbox(lines=10, placeholder="Paste the text to be evaluated here (max 2000 characters)...", label="Text to Evaluate", max_chars=2000) text_input = gr.Textbox(lines=10, placeholder="Paste the text to be evaluated here (max 2000 characters)...", label="Text to Evaluate") evaluate_button = gr.Button("Evaluate") 13 unmodified lines
app.py+6-2