Spaces:
Runtime error
Runtime error
Update app.py
Browse files3 unmodified lines4567891068 unmodified lines79808182838416 unmodified lines10110210310410510610713 unmodified lines1211221233 unmodified linesimport time# Set your OpenAI API keyopenai.api_key = 'sk-proj-fCrObs9lnucfEFwJdMkHT3BlbkFJA7auo8szgjDuHz28QGBW'def extract_text_from_pdf(pdf_file):text = ""68 unmodified linesif not text:return "No text provided for evaluation."evaluation = evaluate_text_against_rubric(rubric, text)if isinstance(evaluation, str): # If it's an error message16 unmodified linesrubric_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)evaluate_button = gr.Button("Evaluate")13 unmodified lines3 unmodified lines4567891068 unmodified lines79808182838485868716 unmodified lines10410510610710810911013 unmodified lines1241251261273 unmodified linesimport time# Set your OpenAI API keyopenai.api_key = 'your-openai-api-key'def extract_text_from_pdf(pdf_file):text = ""68 unmodified linesif 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 linesrubric_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")evaluate_button = gr.Button("Evaluate")13 unmodified lines
app.py+6-2