Spaces:
Sleeping
Sleeping
Commit
ยท
b0aa4c5
1
Parent(s):
7030d78
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,9 +13,6 @@ from torch.utils.data import Dataset, DataLoader, RandomSampler, SequentialSampl
|
|
| 13 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
| 14 |
import gradio as gr
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
def greet(co):
|
| 20 |
code_text = []
|
| 21 |
while True:
|
|
@@ -192,8 +189,41 @@ def T5Trainer(dataframe, source_text, model_params, step="test",):
|
|
| 192 |
|
| 193 |
#################################################################################
|
| 194 |
|
| 195 |
-
demo = gr.Interface(
|
| 196 |
fn = greet,
|
| 197 |
inputs = "text",
|
| 198 |
outputs= "number")
|
| 199 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
| 14 |
import gradio as gr
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
def greet(co):
|
| 17 |
code_text = []
|
| 18 |
while True:
|
|
|
|
| 189 |
|
| 190 |
#################################################################################
|
| 191 |
|
| 192 |
+
'''demo = gr.Interface(
|
| 193 |
fn = greet,
|
| 194 |
inputs = "text",
|
| 195 |
outputs= "number")
|
| 196 |
+
demo.launch(share=True)
|
| 197 |
+
'''
|
| 198 |
+
with gr.Blocks() as demo1:
|
| 199 |
+
gr.Markdown(
|
| 200 |
+
"""
|
| 201 |
+
<h1 align="center">
|
| 202 |
+
False-Alarm-Detector
|
| 203 |
+
</h1>
|
| 204 |
+
""")
|
| 205 |
+
|
| 206 |
+
gr.Markdown(
|
| 207 |
+
"""
|
| 208 |
+
์ ์ ๋ถ์๊ธฐ๋ก ์ค๋ฅ๋ผ๊ณ ๋ณด๊ณ ๋ ์ฝ๋๋ฅผ ์
๋ ฅํ๋ฉด,\
|
| 209 |
+
์ค๋ฅ๊ฐ True-positive ์ธ์ง False-positive ์ธ์ง ๋ถ๋ฅ ํด ์ฃผ๋ ํ๋ก๊ทธ๋จ์ด๋ค.
|
| 210 |
+
""")
|
| 211 |
+
|
| 212 |
+
with gr.Accordion(label='๋ชจ๋ธ์ ๋ํ ์ค๋ช
( ์ฌ๊ธฐ๋ฅผ ํด๋ฆญ ํ์์ค. )',open=False):
|
| 213 |
+
gr.Markdown(
|
| 214 |
+
"""
|
| 215 |
+
์ด 3๊ฐ์ ๋ชจ๋ธ์ ์ฌ์ฉํจ
|
| 216 |
+
์ธ๋ผ์ธ๋ผ
|
| 217 |
+
"""
|
| 218 |
+
)
|
| 219 |
+
with gr.Row():
|
| 220 |
+
with gr.Columns():
|
| 221 |
+
inputs_1 = gr.Textbox(placeholder="์ฝ๋๋ฅผ ์
๋ ฅํ์์ค.", label='Text')
|
| 222 |
+
with gr.Row():
|
| 223 |
+
btn = gr.Button("์ ์ถํ๊ธฐ")
|
| 224 |
+
with gr.Column():
|
| 225 |
+
outputs_1 = gr.Label(num_top_classes=2, label = 'Result')
|
| 226 |
+
btn.click(fn = greet, inputs = inputs_1, outputs= outputs_1)
|
| 227 |
+
|
| 228 |
+
if __name__ == "__main__":
|
| 229 |
+
demo1.launch()
|