ColeGuion commited on
Commit
e5b44fa
·
verified ·
1 Parent(s): f64c0e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -10
app.py CHANGED
@@ -11,19 +11,14 @@ def format_prompt(message, history):
11
 
12
  # String to add before every prompt
13
  prompt_prefix = "Correct any grammatical errors in the following sentence and provide the corrected version:\n\nSentence: "
14
- prompt_template = "[INST] " + prompt_prefix + ' "{}" [/INST] Corrected Sentence:'
15
 
16
- print("History Type: {}".format(type(history)))
17
- print("History: {}".format(history))
18
- if type(history) != type(list()):
19
- print("\nOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\nOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\nOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\n")
20
- #else:
21
- # myList = ["It is my friends house in England.", "It is my friend's house in England."]
22
- #history.append("It is my friends house in England.", "It is my friend's house in England.")
23
- #history.append("Every girl must bring their books to school.", "Every girl must bring her books to school.")
24
 
25
  # Iterates through every past user input and response to be added to the prompt
26
- for user_prompt, bot_response in history:
27
  prompt += prompt_template.format(user_prompt)
28
  prompt += f" {bot_response}</s> "
29
 
 
11
 
12
  # String to add before every prompt
13
  prompt_prefix = "Correct any grammatical errors in the following sentence and provide the corrected version:\n\nSentence: "
14
+ prompt_template = "[INST] " + prompt_prefix + ' "{}" [/INST] Corrected Sentence:'
15
 
16
+
17
+ myList = [["It is my friends house in England.", "It is my friend's house in England."], ["Every girl must bring their books to school.", "Every girl must bring her books to school."]] + history
18
+
 
 
 
 
 
19
 
20
  # Iterates through every past user input and response to be added to the prompt
21
+ for user_prompt, bot_response in myList:
22
  prompt += prompt_template.format(user_prompt)
23
  prompt += f" {bot_response}</s> "
24