israelgonzalezb commited on
Commit
2a57bee
1 Parent(s): 6febd2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1,13 +1,14 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
- pipe = pipeline("summarization", model="google/bigbird-pegasus-large-arxiv")
5
 
6
  def main(in_text):
7
  print(in_text)
8
- answer = pipe(in_text, min_length=5, max_length=round(len(in_text)/4))
9
- print(answer)
10
- return answer[0]["summary_text"]
 
11
 
12
  with gr.Blocks() as demo:
13
  gr.Markdown("""# Summarization Engine!""")
@@ -23,7 +24,7 @@ with gr.Blocks() as demo:
23
  gr.Textbox(label="Attractiveness Score", default="hot"),
24
  ]
25
  b1 = gr.Button("Summarize!")
26
- b1.click(main, inputs=[text1], outputs=["Holy fuck","Holy fucking fuck","That body of yours is insane","hot"], api_name="s")
27
 
28
 
29
 
 
1
  import gradio as gr
2
+ #from transformers import pipeline
3
 
4
+ #pipe = pipeline("summarization", model="google/bigbird-pegasus-large-arxiv")
5
 
6
  def main(in_text):
7
  print(in_text)
8
+ #answer = pipe(in_text, min_length=5, max_length=round(len(in_text)/4))
9
+ #print(answer)
10
+ #return answer[0]["summary_text"]
11
+ return ["Holy fuck","Holy fucking fuck","That body of yours is insane","hot"]
12
 
13
  with gr.Blocks() as demo:
14
  gr.Markdown("""# Summarization Engine!""")
 
24
  gr.Textbox(label="Attractiveness Score", default="hot"),
25
  ]
26
  b1 = gr.Button("Summarize!")
27
+ b1.click(main, inputs=[text1], outputs=output, api_name="s")
28
 
29
 
30