Kosuke-Yamada commited on
Commit
ace8e63
β€’
1 Parent(s): 27449a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -2,6 +2,12 @@ from transformers import pipeline
2
  import gradio as gr
3
  import os
4
 
 
 
 
 
 
 
5
  hf_token = os.getenv("HF_TOKEN")
6
 
7
  model_repository_name = "Kosuke-Yamada/t5_ad_generation2"
@@ -21,4 +27,4 @@ with gr.Blocks() as demo:
21
  output_text = gr.components.Textbox(lines=1, label="η”ŸζˆεΊƒε‘Š")
22
 
23
  submit_button.click(main, inputs=[input_text], outputs=[output_text])
24
- demo.launch()
 
2
  import gradio as gr
3
  import os
4
 
5
+ def auth(user_name, password):
6
+ if user_name == os.getenv("USER_NAME") and password == os.getenv("PASSWORD"):
7
+ return True
8
+ else:
9
+ return False
10
+
11
  hf_token = os.getenv("HF_TOKEN")
12
 
13
  model_repository_name = "Kosuke-Yamada/t5_ad_generation2"
 
27
  output_text = gr.components.Textbox(lines=1, label="η”ŸζˆεΊƒε‘Š")
28
 
29
  submit_button.click(main, inputs=[input_text], outputs=[output_text])
30
+ demo.launch(auth=auth)