dingckc commited on
Commit
26a99da
·
verified ·
1 Parent(s): 0fef5af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -14,8 +14,9 @@ def evaluate_essay(title, essay):
14
  Essay: {essay}
15
  Please generate a detailed evaluation based on the rubric provided above.
16
  """
17
- response = inference(inputs=input_text)
18
- return response.get("generated_text", "No evaluation available.")
 
19
 
20
  # 使用 Gradio 構建界面
21
  title_input = gr.Textbox(label="Essay Title")
 
14
  Essay: {essay}
15
  Please generate a detailed evaluation based on the rubric provided above.
16
  """
17
+ # 使用 text_generation 方法進行推理
18
+ response = inference.text_generation(input_text)
19
+ return response[0]["generated_text"] if "generated_text" in response[0] else "No evaluation available."
20
 
21
  # 使用 Gradio 構建界面
22
  title_input = gr.Textbox(label="Essay Title")