Eitan Lifshits commited on
Commit
3a01999
1 Parent(s): 2260c65

fix output format

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -5,13 +5,16 @@ from transformers import pipeline
5
  summarizer = pipeline('summarization', model='Eitanli/resume_label_summary_model')
6
 
7
 
8
- def predict(text):
9
- summary = summarizer(text, max_length=10, min_length=2)
10
  return summary[0]['summary_text']
11
 
12
 
13
  iface = gr.Interface(
14
  fn=predict,
15
- inputs='text',
 
 
 
16
  outputs="text")
17
  iface.launch()
 
5
  summarizer = pipeline('summarization', model='Eitanli/resume_label_summary_model')
6
 
7
 
8
+ def predict(text, min_length, max_length):
9
+ summary = summarizer(text, min_length=min_length, max_length=max_length)
10
  return summary[0]['summary_text']
11
 
12
 
13
  iface = gr.Interface(
14
  fn=predict,
15
+ inputs=[
16
+ gr.Textbox(label="Paste resume here"),
17
+ gr.Slider(2, 20, step=1.0, value=2, label="min_length", info="Choose between 2 and 20"),
18
+ gr.Slider(10, 30, step=1.0, value=10, label="max_length", info="Choose between 10 and 30")],
19
  outputs="text")
20
  iface.launch()