Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ interface = gr.Interface(
|
|
15 |
fn=get_sentiment, # ํธ์ถ๋ ํจ์
|
16 |
inputs=gr.inputs.Textbox(lines=2, placeholder="์ฌ๊ธฐ์ ํ
์คํธ๋ฅผ ์
๋ ฅํ์ธ์..."), # ์
๋ ฅ๋ ์ค์
|
17 |
outputs="text", # ์ถ๋ ฅ ํ์
|
18 |
-
title="
|
19 |
description="์ด ์ฑ์ ์
๋ ฅ๋ ํ
์คํธ์ ๊ฐ์ฑ์ ๋ถ์ํฉ๋๋ค. ๊ธ์ ์ ์ด๊ฑฐ๋ ๋ถ์ ์ ์ธ ๊ฒฐ๊ณผ๋ฅผ ๋ณด์ฌ์ค๋๋ค.", # UI ์ค๋ช
|
20 |
examples=[["์ด ์ ํ์ ์ ๋ง ์ข์ต๋๋ค!"], ["์ ๊ธฐ๋์ ๋ชป ๋ฏธ์ณค์ด์."]], # ์์ ์
๋ ฅ
|
21 |
theme="default", # UI ํ
๋ง
|
@@ -25,45 +25,5 @@ interface = gr.Interface(
|
|
25 |
# Gradio ์ฑ ์คํ
|
26 |
interface.launch()
|
27 |
|
28 |
-
# import gradio as gr
|
29 |
-
|
30 |
-
# def get_pipe():
|
31 |
-
# from transformers import AutoTokenizer, AutoModelForCausalLM
|
32 |
-
# model_name = "heegyu/koalpaca-355m"
|
33 |
-
# tokenizer = AutoTokenizer.from_pretrained(model_name)
|
34 |
-
# tokenizer.truncation_side = "right"
|
35 |
-
# model = AutoModelForCausalLM.from_pretrained(model_name)
|
36 |
-
# return model, tokenizer
|
37 |
-
|
38 |
-
# def get_response(tokenizer, model, context):
|
39 |
-
# context = f"<usr>{context}\n<sys>"
|
40 |
-
# inputs = tokenizer(
|
41 |
-
# context,
|
42 |
-
# truncation=True,
|
43 |
-
# max_length=512,
|
44 |
-
# return_tensors="pt")
|
45 |
-
|
46 |
-
# generation_args = dict(
|
47 |
-
# max_length=256,
|
48 |
-
# min_length=64,
|
49 |
-
# eos_token_id=2,
|
50 |
-
# do_sample=True,
|
51 |
-
# top_p=1.0,
|
52 |
-
# early_stopping=True
|
53 |
-
# )
|
54 |
-
|
55 |
-
# outputs = model.generate(**inputs, **generation_args)
|
56 |
-
# response = tokenizer.decode(outputs[0])
|
57 |
-
# print(context)
|
58 |
-
# print(response)
|
59 |
-
# response = response[len(context):].replace("</s>", "")
|
60 |
-
|
61 |
-
# return response
|
62 |
-
|
63 |
-
# model, tokenizer = get_pipe()
|
64 |
-
|
65 |
-
# def ask_question(input_):
|
66 |
-
# response = get_response(tokenizer, model, input_)
|
67 |
-
# return response
|
68 |
|
69 |
# gr.Interface(fn=ask_question, inputs="text", outputs="text", title="KoAlpaca-355M", description="ํ๊ตญ์ด๋ก ์ง๋ฌธํ์ธ์.").launch()
|
|
|
15 |
fn=get_sentiment, # ํธ์ถ๋ ํจ์
|
16 |
inputs=gr.inputs.Textbox(lines=2, placeholder="์ฌ๊ธฐ์ ํ
์คํธ๋ฅผ ์
๋ ฅํ์ธ์..."), # ์
๋ ฅ๋ ์ค์
|
17 |
outputs="text", # ์ถ๋ ฅ ํ์
|
18 |
+
title="Sentiment Analysis", # UI ์ ๋ชฉ
|
19 |
description="์ด ์ฑ์ ์
๋ ฅ๋ ํ
์คํธ์ ๊ฐ์ฑ์ ๋ถ์ํฉ๋๋ค. ๊ธ์ ์ ์ด๊ฑฐ๋ ๋ถ์ ์ ์ธ ๊ฒฐ๊ณผ๋ฅผ ๋ณด์ฌ์ค๋๋ค.", # UI ์ค๋ช
|
20 |
examples=[["์ด ์ ํ์ ์ ๋ง ์ข์ต๋๋ค!"], ["์ ๊ธฐ๋์ ๋ชป ๋ฏธ์ณค์ด์."]], # ์์ ์
๋ ฅ
|
21 |
theme="default", # UI ํ
๋ง
|
|
|
25 |
# Gradio ์ฑ ์คํ
|
26 |
interface.launch()
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
# gr.Interface(fn=ask_question, inputs="text", outputs="text", title="KoAlpaca-355M", description="ํ๊ตญ์ด๋ก ์ง๋ฌธํ์ธ์.").launch()
|