Spaces:
Build error
Build error
File size: 769 Bytes
de24b01 44e47bd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from transformers import pipeline
import random
import gradio as gr
from translate import Translator
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
def classfi(input):
classifier= pipeline("sentiment-analysis")
translator= Translator(from_lang="ko", to_lang="en")
inputko=translator.translate(input)
return classifier(inputko)
with gr.Blocks(css=".gradio-container {background-color: white}") as demo:
name=gr.Textbox(label="ํ๊ณ ์ถ์ ์ด์ผ๊ธฐ๋ฅผ ์ ์ด ๊ฐ์ ๋ถ์ํ๊ธฐ ๋ฒํผ์ ๋๋ฌ๋ณด์ธ์")
output=gr.Textbox(label="๋น์ ์ ๊ฐ์ ์ํ๋ฅผ ์๋ ค์ค๋๋ค.")
greet_btn = gr.Button("๊ฐ์ ๋ถ์ํ๊ธฐ")
greet_btn.click(fn=classfi, inputs=name, outputs=output)
demo.launch(debug = True, share =False)
|