ShynBui commited on
Commit
f47dd3c
1 Parent(s): 545795d

add example

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,11 +1,12 @@
1
  import gradio as gr
2
  import spaces
3
  from transformers import pipeline
 
4
 
5
  pipe = pipeline("summarization", model="ShynBui/Bartpho_spelling_correction")
6
 
7
  def greet(text):
8
  return pipe(text, max_new_tokens= 512)[0]['summary_text']
9
 
10
- demo = gr.Interface(fn=greet, inputs=gr.Text(), outputs=gr.Text())
11
  demo.launch()
 
1
  import gradio as gr
2
  import spaces
3
  from transformers import pipeline
4
+ import os
5
 
6
  pipe = pipeline("summarization", model="ShynBui/Bartpho_spelling_correction")
7
 
8
  def greet(text):
9
  return pipe(text, max_new_tokens= 512)[0]['summary_text']
10
 
11
+ demo = gr.Interface(fn=greet, inputs=gr.Text(), outputs=gr.Text(), examples=eval(os.environ['DES_EXAMPLE']))
12
  demo.launch()