haramkoo commited on
Commit
9190e7c
·
1 Parent(s): b1f712d

model descriptions and examples draft01

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -18,19 +18,19 @@ examples = [
18
 
19
  # pass in Strings of model choice and input text for context
20
  def genQuestion(model_choice, context):
21
- global description
22
  if model_choice=="interview-question-remake":
23
  model = BartForConditionalGeneration.from_pretrained("hyechanjun/interview-question-remake")
24
  tok = BartTokenizer.from_pretrained("hyechanjun/interview-question-remake")
25
- description = "Interview question remake is a model that..."
26
  elif model_choice=="interview-length-tagged":
27
  model = BartForConditionalGeneration.from_pretrained("hyechanjun/interview-length-tagged")
28
  tok = BartTokenizer.from_pretrained("hyechanjun/interview-length-tagged")
29
- description = "Interview question tagged is a model that..."
30
  elif model_choice=="reverse-interview-question":
31
  model = BartForConditionalGeneration.from_pretrained("hyechanjun/reverse-interview-question")
32
  tok = BartTokenizer.from_pretrained("hyechanjun/reverse-interview-question")
33
- description = "Reverse interview question is a model that..."
34
 
35
  inputs = tok(context, return_tensors="pt")
36
  output = model.generate(inputs["input_ids"], num_beams=4, max_length=64, min_length=9, num_return_sequences=4, diversity_penalty =1.0, num_beam_groups=2)
@@ -41,5 +41,5 @@ def genQuestion(model_choice, context):
41
 
42
  return final_output
43
 
44
- iface = gr.Interface(fn=genQuestion, inputs=[gr.inputs.Dropdown(["interview-question-remake", "interview-length-tagged", "reverse-interview-question"]), "text"], examples=examples, description=description, outputs="text")
45
  iface.launch()
 
18
 
19
  # pass in Strings of model choice and input text for context
20
  def genQuestion(model_choice, context):
21
+ global descriptions
22
  if model_choice=="interview-question-remake":
23
  model = BartForConditionalGeneration.from_pretrained("hyechanjun/interview-question-remake")
24
  tok = BartTokenizer.from_pretrained("hyechanjun/interview-question-remake")
25
+ descriptions = "Interview question remake is a model that..."
26
  elif model_choice=="interview-length-tagged":
27
  model = BartForConditionalGeneration.from_pretrained("hyechanjun/interview-length-tagged")
28
  tok = BartTokenizer.from_pretrained("hyechanjun/interview-length-tagged")
29
+ descriptions = "Interview question tagged is a model that..."
30
  elif model_choice=="reverse-interview-question":
31
  model = BartForConditionalGeneration.from_pretrained("hyechanjun/reverse-interview-question")
32
  tok = BartTokenizer.from_pretrained("hyechanjun/reverse-interview-question")
33
+ descriptions = "Reverse interview question is a model that..."
34
 
35
  inputs = tok(context, return_tensors="pt")
36
  output = model.generate(inputs["input_ids"], num_beams=4, max_length=64, min_length=9, num_return_sequences=4, diversity_penalty =1.0, num_beam_groups=2)
 
41
 
42
  return final_output
43
 
44
+ iface = gr.Interface(fn=genQuestion, inputs=[gr.inputs.Dropdown(["interview-question-remake", "interview-length-tagged", "reverse-interview-question"]), "text"], examples=examples, description=descriptions, outputs="text")
45
  iface.launch()