everything works seamlessly
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
|
|
@@ -10,8 +11,16 @@ def check_password(username, password):
|
|
| 10 |
read_key = os.environ.get("HF_TOKEN", None)
|
| 11 |
|
| 12 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
with gr.Blocks() as demo:
|
| 14 |
-
gr.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
demo.queue(max_size=10)
|
| 17 |
demo.launch(auth=check_password)
|
|
|
|
| 1 |
+
from gradio_client import Client
|
| 2 |
import gradio as gr
|
| 3 |
import os
|
| 4 |
|
|
|
|
| 11 |
read_key = os.environ.get("HF_TOKEN", None)
|
| 12 |
|
| 13 |
if __name__ == "__main__":
|
| 14 |
+
client = Client.duplicate("Nauryzbay/deckify_private", hf_token=read_key)
|
| 15 |
+
|
| 16 |
+
func = lambda file, number_of_pages: client.predict(file, number_of_pages)
|
| 17 |
+
|
| 18 |
with gr.Blocks() as demo:
|
| 19 |
+
file = gr.File(label="Upload PDF")
|
| 20 |
+
number_of_pages = gr.Number(label="Number of pages")
|
| 21 |
+
output = gr.Textbox(label="Output")
|
| 22 |
+
greet_btn = gr.Button("Generate slides")
|
| 23 |
+
greet_btn.click(fn=func, inputs=[file, number_of_pages], outputs=output, api_name="greet")
|
| 24 |
|
| 25 |
demo.queue(max_size=10)
|
| 26 |
demo.launch(auth=check_password)
|