Spaces:
Running
Running
Kosuke-Yamada
commited on
Commit
β’
ace8e63
1
Parent(s):
27449a7
Update app.py
Browse files
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)
|