Spaces:
Runtime error
Runtime error
suppose it works
Browse files
app.py
CHANGED
@@ -1,24 +1,17 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
# output = gr.Textbox(label="Output")
|
9 |
-
# greet_btn = gr.Button("Generate slides")
|
10 |
-
# greet_btn.click(fn=generate_slides, inputs=[file, number_of_pages], outputs=output, api_name="greet")
|
11 |
-
with gr.Blocks() as demo:
|
12 |
-
io = gr.Interface.load("spaces/Nauryzbay/deckify_private")
|
13 |
-
file = gr.File(label="Upload PDF")
|
14 |
-
number_of_pages = gr.Number(label="Number of pages")
|
15 |
-
greet_btn = gr.Button("Generate slides")
|
16 |
-
greet_btn.click(fn=io, inputs=[file, number_of_pages], api_name="greet")
|
17 |
|
18 |
-
|
19 |
-
demo.launch()
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
|
4 |
+
def check_password(username, password):
|
5 |
+
if password == os.environ["ACCESS"]:
|
6 |
+
return True
|
7 |
+
else:
|
8 |
+
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
read_key = os.environ.get("HF_TOKEN", None)
|
|
|
11 |
|
12 |
+
if __name__ == "__main__":
|
13 |
+
with gr.Blocks() as demo:
|
14 |
+
gr.load("Nauryzbay/deckify_private", hf_token=read_key, src="spaces")
|
15 |
+
|
16 |
+
demo.queue(max_size=10)
|
17 |
+
demo.launch(auth=check_password)
|