Ahsen Khaliq
commited on
Commit
Β·
9d054ad
1
Parent(s):
0ba1651
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,10 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
14 |
).to(device='cpu', non_blocking=True)
|
15 |
_ = model.eval()
|
16 |
|
17 |
-
|
18 |
-
|
|
|
|
|
19 |
def greet(text):
|
20 |
prompt = text
|
21 |
with torch.no_grad():
|
@@ -25,5 +27,5 @@ def greet(text):
|
|
25 |
|
26 |
return generated
|
27 |
|
28 |
-
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
29 |
iface.launch()
|
|
|
14 |
).to(device='cpu', non_blocking=True)
|
15 |
_ = model.eval()
|
16 |
|
17 |
+
title = "KoGPT"
|
18 |
+
description = "Gradio demo for KoGPT(Korean Generative Pre-trained Transformer). To use it, simply add your text, or click one of the examples to load them. Read more at the links below."
|
19 |
+
article = "<p style='text-align: center'><a href='https://github.com/kakaobrain/kogpt'>KoGPT: KakaoBrain Korean(hangul) Generative Pre-trained Transformer</a> | <a href='https://huggingface.co/kakaobrain/kogpt'>Huggingface Model</a></p>"
|
20 |
+
examples=[['μΈκ°μ²λΌ μκ°νκ³ , νλνλ \'μ§λ₯\'μ ν΅ν΄ μΈλ₯κ° μ΄μ κΉμ§ νμ§ λͺ»νλ']]
|
21 |
def greet(text):
|
22 |
prompt = text
|
23 |
with torch.no_grad():
|
|
|
27 |
|
28 |
return generated
|
29 |
|
30 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs="text", title=title, description=description, article=article, examples=examples)
|
31 |
iface.launch()
|