Spaces:
Runtime error
Runtime error
import gradio as gr | |
def generate_ielts_essay(prompt): | |
# You may want to customize the max_length and other parameters according to your needs | |
return "Hello " + prompt + "!!" | |
def grade_essay(essay): | |
# Simple grading function. Replace with a more sophisticated essay grading algorithm. | |
words = essay.split() | |
if len(words) > 200: | |
return "Good" | |
else: | |
return "Poor" | |
iface = gr.Interface( | |
fn={"Generate": generate_ielts_essay, "Grade": grade_essay}, | |
inputs={"Generate": gr.inputs.Textbox(lines=3, placeholder="Enter IELTS writing prompt here..."), | |
"Grade": gr.inputs.Textbox(lines=10, placeholder="Paste the essay text here...")}, | |
outputs="text", | |
title="IELTS Essay Generator and Grader", | |
description="This tool generates a response to an IELTS writing prompt using AI and provides a simple grading.", | |
) | |
iface.launch() | |