minseokKoo commited on
Commit
b0aa4c5
โ€ข
1 Parent(s): 7030d78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -5
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()