Spaces:
Running
Running
Update gradio_app.py
Browse files- gradio_app.py +4 -4
gradio_app.py
CHANGED
@@ -3,8 +3,8 @@ from huggingface_hub import InferenceClient
|
|
3 |
from gradio_client import Client, handle_file
|
4 |
|
5 |
|
6 |
-
def infer(text_prompt, action_prompt,
|
7 |
-
print(
|
8 |
|
9 |
inf_client = InferenceClient(
|
10 |
provider="replicate",
|
@@ -56,12 +56,12 @@ with gr.Blocks() as demo:
|
|
56 |
|
57 |
text_prompt = gr.Textbox(label="Icon label")
|
58 |
action_prompt = gr.Textbox(label="Action label")
|
59 |
-
|
60 |
image_out = gr.Image()
|
61 |
video_out = gr.Video()
|
62 |
|
63 |
|
64 |
-
|
65 |
fn = infer,
|
66 |
inputs = [text_prompt, action_prompt],
|
67 |
outputs = [image_out, video_out]
|
|
|
3 |
from gradio_client import Client, handle_file
|
4 |
|
5 |
|
6 |
+
def infer(text_prompt, action_prompt, oauth_token: gr.OAuthToken):
|
7 |
+
print(oauth_token.token)
|
8 |
|
9 |
inf_client = InferenceClient(
|
10 |
provider="replicate",
|
|
|
56 |
|
57 |
text_prompt = gr.Textbox(label="Icon label")
|
58 |
action_prompt = gr.Textbox(label="Action label")
|
59 |
+
submit_btn = gr.Button("Submit")
|
60 |
image_out = gr.Image()
|
61 |
video_out = gr.Video()
|
62 |
|
63 |
|
64 |
+
submit_btn.click(
|
65 |
fn = infer,
|
66 |
inputs = [text_prompt, action_prompt],
|
67 |
outputs = [image_out, video_out]
|