mohamedemam commited on
Commit
574cab5
·
1 Parent(s): 4f97373

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -56,8 +56,8 @@ recommended_words = [
56
  ]
57
 
58
  # Function to generate questions and answers with configurable parameters
59
- def generate_qa(context, recommended_word, temperature, top_p,num_seq,l_p, num_b):
60
- input_text = f"{recommended_word}: {context}"
61
  input_text=re.sub(f'\n'," ",input_text).lower()
62
  input_ids = tokenizer(input_text, return_tensors='pt')
63
 
@@ -79,8 +79,8 @@ def generate_qa(context, recommended_word, temperature, top_p,num_seq,l_p, num_b
79
  return formatted_output
80
  iface = gr.Interface(
81
  fn=generate_qa,
82
- inputs=[
83
- gr.inputs.Dropdown(example_contexts, label="Choose an Example"),
84
  gr.inputs.Radio(recommended_words, label="Choose a Recommended Word"),
85
  gr.inputs.Slider(minimum=0.0, maximum=5, default=2.1, step=0.01, label="Temperature"),
86
  gr.inputs.Slider(minimum=0.0, maximum=1, default=0.5, step=0.01, label="Top-p"),
 
56
  ]
57
 
58
  # Function to generate questions and answers with configurable parameters
59
+ def generate_qa(text,context, recommended_word, temperature, top_p,num_seq,l_p, num_b):
60
+ input_text = f"{recommended_word}: {text+context}"
61
  input_text=re.sub(f'\n'," ",input_text).lower()
62
  input_ids = tokenizer(input_text, return_tensors='pt')
63
 
 
79
  return formatted_output
80
  iface = gr.Interface(
81
  fn=generate_qa,
82
+ inputs=["text",
83
+ gr.inputs.Dropdown([" "]+example_contexts, label="Choose an Example"),
84
  gr.inputs.Radio(recommended_words, label="Choose a Recommended Word"),
85
  gr.inputs.Slider(minimum=0.0, maximum=5, default=2.1, step=0.01, label="Temperature"),
86
  gr.inputs.Slider(minimum=0.0, maximum=1, default=0.5, step=0.01, label="Top-p"),