abnerzhang commited on
Commit
6e4a82c
·
1 Parent(s): ea0e302

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -4,12 +4,12 @@ def generate_ielts_essay(prompt):
4
  # You may want to customize the max_length and other parameters according to your needs
5
  return "Hello " + prompt + "!!"
6
  def format_chat_prompt(message, band, chat_history, instruction):
7
- prompt = f"System:{instruction}"
8
- for turn in chat_history:
9
- user_message, bot_message = turn
10
- prompt = f"{prompt}\nUser: {user_message}\nAssistant: {bot_message}"
11
- prompt = f"{prompt}\nUser: IELTS Writing Band {band} - {message}\nAssistant:"
12
- return prompt
13
 
14
  def respond(message, band, chat_history, instruction, temperature=0.7):
15
  prompt = format_chat_prompt(message, band, chat_history, instruction)
 
4
  # You may want to customize the max_length and other parameters according to your needs
5
  return "Hello " + prompt + "!!"
6
  def format_chat_prompt(message, band, chat_history, instruction):
7
+ prompt = f"System:{instruction}"
8
+ for turn in chat_history:
9
+ user_message, bot_message = turn
10
+ prompt = f"{prompt}\nUser: {user_message}\nAssistant: {bot_message}"
11
+ prompt = f"{prompt}\nUser: IELTS Writing Band {band} - {message}\nAssistant:"
12
+ return prompt
13
 
14
  def respond(message, band, chat_history, instruction, temperature=0.7):
15
  prompt = format_chat_prompt(message, band, chat_history, instruction)