Spaces:
Runtime error
Runtime error
import gradio as gr | |
def generate_essay(prompt, band_score): | |
# replace this with code to generate essay text using AI | |
return "Generated essay text" | |
def grade_essay(essay_text): | |
# replace this with code to grade the essay text using AI | |
return "Band Score: 7.5" | |
with gr.Blocks() as app: | |
prompt = gr.Textbox(label="IELTS Writing Prompt", | |
lines=3, | |
placeholder="Enter IELTS writing prompt here...", | |
value="IELTS Essay Task 1: Department Stores and Online Stores in Australia\n\n" | |
"The table gives information about department and online stores in Australia in 2011.\n" | |
"Summarise the information by selecting and reporting the main features, and make comparisons where relevant.\n\n" | |
"Department Stores Online Stores\n" | |
"Number of Businesses 67 368\n" | |
"Profit (AUD) 807 863\n" | |
"Sales Revenue (AUD) 12,700 13,400\n" | |
"Growth .4% .6%") | |
essay = gr.Textbox(label="Generated Essay", | |
lines=10, | |
placeholder="Generated essay will appear here...") | |
for band_score in range(6, 10): | |
btn = gr.Button(f"Generate Band {band_score} Essay") | |
btn.click(generate_essay, inputs=prompt, outputs=essay) | |
grade = gr.Button("Grade") | |
grade_result = gr.Textbox(label="Grade Result", | |
lines=2, | |
placeholder="Graded result will appear here...") | |
grade.click(grade_essay, inputs=essay, outputs=grade_result) | |
app.launch() | |