Spaces:
Paused
Paused
ElPlaguister
commited on
Commit
โข
bbc20a6
1
Parent(s):
4db1eca
Feat Different Placeholder Each Model
Browse files
app.py
CHANGED
@@ -52,20 +52,19 @@ if __name__=='__main__':
|
|
52 |
readme = f.read()
|
53 |
|
54 |
MODELS.append(T5())
|
|
|
55 |
if not LOCAL_TEST:
|
56 |
MODELS.append(KoAlpaca())
|
|
|
57 |
|
58 |
with gr.Blocks(theme=prepare_theme()) as demo:
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
txt = gr.Textbox(show_label=False, placeholder='์ฐ์ ๊ด๋ จ ์ง๋ฌธ์ ์
๋ ฅํ์ธ์!', container=False, elem_id=i)
|
68 |
-
|
69 |
-
txt.submit(MODELS[i].chat, [txt, chatbot], [txt, chatbot])
|
70 |
|
71 |
demo.launch(debug=True, share=True)
|
|
|
52 |
readme = f.read()
|
53 |
|
54 |
MODELS.append(T5())
|
55 |
+
MODELS[0].placeholder = '์ฐ์ ๊ด๋ จ ์ง๋ฌธ์ ์
๋ ฅํ์ธ์!'
|
56 |
if not LOCAL_TEST:
|
57 |
MODELS.append(KoAlpaca())
|
58 |
+
MODELS[1].placeholder = '์ฐ์ ๊ด๋ จ ์ง๋ฌธ์ ์
๋ ฅํ์ธ์. (KoAlpaca๋ ์ถ๋ก ์ 1๋ถ ์ด์ ์์๋ฉ๋๋ค!)'
|
59 |
|
60 |
with gr.Blocks(theme=prepare_theme()) as demo:
|
61 |
+
gr.HTML("<h1>KOMUChat : Korean community-style relationship counseling chabot</h1>")
|
62 |
+
with gr.Tab("์๊ฐ"):
|
63 |
+
gr.Markdown(readme)
|
64 |
+
for i in range(len(MODELS)):
|
65 |
+
with gr.Tab(MODEL_STRS[i]):
|
66 |
+
chatbot = gr.Chatbot(label=MODEL_STRS[i], bubble_full_width=False)
|
67 |
+
txt = gr.Textbox(show_label=False, placeholder=MODELS[i].placeholder, container=False, elem_id=i)
|
68 |
+
txt.submit(MODELS[i].chat, [txt, chatbot], [txt, chatbot])
|
|
|
|
|
|
|
69 |
|
70 |
demo.launch(debug=True, share=True)
|
model.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
class Model:
|
3 |
def __init__(self,
|
4 |
-
name:str="Model"
|
|
|
5 |
self.name = name
|
|
|
6 |
self.model = None
|
7 |
self.tokenizer = None
|
8 |
self.gen_config = None
|
|
|
1 |
import gradio as gr
|
2 |
class Model:
|
3 |
def __init__(self,
|
4 |
+
name:str="Model",
|
5 |
+
placeholder:str="Input"):
|
6 |
self.name = name
|
7 |
+
self.placeholder = placeholder
|
8 |
self.model = None
|
9 |
self.tokenizer = None
|
10 |
self.gen_config = None
|