KneeKhan commited on
Commit
fc61ccf
·
1 Parent(s): 9d0d207

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -30,7 +30,7 @@ def query(payload, API_URL):
30
  response = requests.request("POST", API_URL, json=payload)
31
  return response.json()
32
 
33
- def pre_query(recipient, recipient_name, sender, context, dates, input, model_id):
34
  API_URL = "https://api-inference.huggingface.co/models/" + model_id
35
 
36
  if model_id == "bigscience/T0pp":
@@ -84,13 +84,12 @@ with demo:
84
  recipient_name = gr.Textbox(label="Recipient Name", placeholder = "Their name is...")
85
 
86
  subject = gr.Dropdown([ "Requesting a meeting", "Conflict with scheduled meeting time", "Requesting clarification", "Requesting to leave early", "Requesting a leave of absence", "Requesting a letter of recommendation", "Requesting a referral for a job application"], label= "Subject/Context")
87
- dates = gr.Textbox(label="Relevant Dates", placeholder ="MM/DD/YYYY")
88
  email = gr.Textbox(label="Input", lines=10, placeholder="Enter your Message Here!")
89
  model_id = gr.Dropdown(["GPT-3", "bigscience/T0pp", "bigscience/bloom", "EleutherAI/gpt-neo-2.7B"] ,label = "model_id")
90
  submit_button = gr.Button("Generate my email!")
91
  text_output = gr.Textbox(lines=10, label = "Email", placeholder = "Your generated email!", interactive = True)
92
 
93
- input_list = [sender, recipient, recipient_name, subject, dates, email, model_id]
94
 
95
  submit_button.click(pre_query, inputs = input_list, outputs=text_output)
96
 
 
30
  response = requests.request("POST", API_URL, json=payload)
31
  return response.json()
32
 
33
+ def pre_query(sender, recipient, recipient_name, context, input, model_id):
34
  API_URL = "https://api-inference.huggingface.co/models/" + model_id
35
 
36
  if model_id == "bigscience/T0pp":
 
84
  recipient_name = gr.Textbox(label="Recipient Name", placeholder = "Their name is...")
85
 
86
  subject = gr.Dropdown([ "Requesting a meeting", "Conflict with scheduled meeting time", "Requesting clarification", "Requesting to leave early", "Requesting a leave of absence", "Requesting a letter of recommendation", "Requesting a referral for a job application"], label= "Subject/Context")
 
87
  email = gr.Textbox(label="Input", lines=10, placeholder="Enter your Message Here!")
88
  model_id = gr.Dropdown(["GPT-3", "bigscience/T0pp", "bigscience/bloom", "EleutherAI/gpt-neo-2.7B"] ,label = "model_id")
89
  submit_button = gr.Button("Generate my email!")
90
  text_output = gr.Textbox(lines=10, label = "Email", placeholder = "Your generated email!", interactive = True)
91
 
92
+ input_list = [sender, recipient, recipient_name, subject, email, model_id]
93
 
94
  submit_button.click(pre_query, inputs = input_list, outputs=text_output)
95