steve7909 commited on
Commit
ab627a5
1 Parent(s): 4fd1123

simpler english

Browse files
Files changed (1) hide show
  1. app.py +14 -11
app.py CHANGED
@@ -34,6 +34,8 @@ headers = {"Authorization": f"Bearer {HF_TOKEN}"}
34
  # Global variable to control debug printing
35
  DEBUG_MODE = True
36
 
 
 
37
  try:
38
  file_path = "issun-boshi.txt"
39
  # Open the file in read mode ('r')
@@ -155,16 +157,17 @@ def predict(message, history):
155
  except Exception as e:
156
  debug_print("Error in streaming output", str(e))
157
 
158
- strategies = '''making connections between the text and their prior knowledge;
159
- forming and testing hypotheses about texts;
160
- asking questions about the text;
161
- creating mental images or visualising;
162
- inferring meaning from the text;
163
- identifying the writer’s purpose and point of view;
164
- identifying the main idea or theme in the text;
165
- summarising the information or events in the text;
166
- analysing and synthesising ideas, information, structures, and features in the text;
167
- evaluating ideas and information'''
 
168
 
169
 
170
  with gr.Blocks() as demo:
@@ -172,7 +175,7 @@ with gr.Blocks() as demo:
172
  learner_data = gr.Textbox(label="Learner Data", placeholder="Enter learner data here...", lines=4, value="Honoka is a Japanese EFL student. [summary of relevant student data]")
173
  learning_content = gr.Textbox(label="Learning Content", placeholder="Enter learning content here...", lines=4, value=learning_content)
174
  teacher_prompt = gr.Textbox(label="Teacher Prompt", placeholder="Enter chat guidance here...", lines=4,
175
- value=f"You are a professional EFL teacher. Help the student actively read the text using these strategies: {strategies}. Guide the conversation to discuss the Learning Content below.")
176
 
177
  # pre prompt the history_openai_format list
178
  history_openai_format.append({"role": "system", "content": f"{teacher_prompt.value} Learner Data: {learner_data.value}. Learning Content: {learning_content.value}. "})
 
34
  # Global variable to control debug printing
35
  DEBUG_MODE = True
36
 
37
+ file_content = "Not yet loaded"
38
+
39
  try:
40
  file_path = "issun-boshi.txt"
41
  # Open the file in read mode ('r')
 
157
  except Exception as e:
158
  debug_print("Error in streaming output", str(e))
159
 
160
+ strategies = '''
161
+ - making connections between the text and their prior knowledge;
162
+ - forming and testing hypotheses about texts;
163
+ - asking questions about the text;
164
+ - creating mental images or visualising;
165
+ - inferring meaning from the text;
166
+ - identifying the writer’s purpose and point of view;
167
+ - identifying the main idea or theme in the text;
168
+ - summarising the information or events in the text;
169
+ - analysing and synthesising ideas, information, structures, and features in the text;
170
+ - evaluating ideas and information'''
171
 
172
 
173
  with gr.Blocks() as demo:
 
175
  learner_data = gr.Textbox(label="Learner Data", placeholder="Enter learner data here...", lines=4, value="Honoka is a Japanese EFL student. [summary of relevant student data]")
176
  learning_content = gr.Textbox(label="Learning Content", placeholder="Enter learning content here...", lines=4, value=learning_content)
177
  teacher_prompt = gr.Textbox(label="Teacher Prompt", placeholder="Enter chat guidance here...", lines=4,
178
+ value=f"You are a professional EFL teacher. Help the student actively read the text using these strategies: {strategies}. Use simple vocabulary and short sentences a beginner would understand. Guide the conversation to discuss the Learning Content below.")
179
 
180
  # pre prompt the history_openai_format list
181
  history_openai_format.append({"role": "system", "content": f"{teacher_prompt.value} Learner Data: {learner_data.value}. Learning Content: {learning_content.value}. "})