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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -13
app.py CHANGED
@@ -1,14 +1,13 @@
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!""")
@@ -18,15 +17,9 @@ with gr.Blocks() as demo:
18
  label="Input Text",
19
  lines=1,
20
  )
21
- output = [gr.Textbox(label="Total Hot or Not™ Score", default="Holy fuck"),
22
- gr.Textbox(label="Hotness Score", default="Holy fucking fuck"),
23
- gr.Textbox(label="Beauty Score", default="That body of yours is insane"),
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
 
31
 
32
 
 
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!""")
 
17
  label="Input Text",
18
  lines=1,
19
  )
20
+ output = gr.Textbox(label="Output Text")
 
 
 
 
21
  b1 = gr.Button("Summarize!")
22
  b1.click(main, inputs=[text1], outputs=output, api_name="s")
 
 
23
 
24
 
25