Spaces:
Running
Running
Update app.py
Browse files
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]
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
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
|
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 |
|