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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -11,10 +11,11 @@ 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
 
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
@@ -50,7 +51,7 @@ def generate(prompt, history, system_prompt, temperature=0.9, max_new_tokens=256
50
 
51
 
52
  additional_inputs=[
53
- gr.Textbox( label="System Prompt", value="Correct the following sentence to make it grammatically accurate while maintaining the original meaning. Output only the corrected sentence." , max_lines=1, interactive=True, ),
54
  gr.Slider( label="Temperature", value=0.9, minimum=0.0, maximum=1.0, step=0.05, interactive=True, info="Higher values produce more diverse outputs", ),
55
  gr.Slider( label="Max new tokens", value=256, minimum=0, maximum=1048, step=64, interactive=True, info="The maximum numbers of new tokens", ),
56
  gr.Slider( label="Top-p (nucleus sampling)", value=0.90, minimum=0.0, maximum=1, step=0.05, interactive=True, info="Higher values sample more low-probability tokens", ),
 
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
+ 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."]]
18
+ myList = myList + history
19
 
20
 
21
  # Iterates through every past user input and response to be added to the prompt
 
51
 
52
 
53
  additional_inputs=[
54
+ gr.Textbox( label="System Prompt", value="Correct the following sentence to make it grammatically accurate while maintaining the original meaning. Your response should contain nothing more than the corrected text and nothing more." , max_lines=1, interactive=True, ),
55
  gr.Slider( label="Temperature", value=0.9, minimum=0.0, maximum=1.0, step=0.05, interactive=True, info="Higher values produce more diverse outputs", ),
56
  gr.Slider( label="Max new tokens", value=256, minimum=0, maximum=1048, step=64, interactive=True, info="The maximum numbers of new tokens", ),
57
  gr.Slider( label="Top-p (nucleus sampling)", value=0.90, minimum=0.0, maximum=1, step=0.05, interactive=True, info="Higher values sample more low-probability tokens", ),