Spaces:
Runtime error
Runtime error
add example
Browse files
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()
|