Spaces:
Build error
Build error
Update gradio_app.py
Browse files- gradio_app.py +9 -6
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",
|
|
@@ -52,18 +52,21 @@ with gr.Blocks() as demo:
|
|
| 52 |
|
| 53 |
with gr.Column():
|
| 54 |
|
| 55 |
-
|
| 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 |
fn = infer,
|
| 65 |
-
inputs = [text_prompt, action_prompt
|
| 66 |
outputs = [image_out, video_out]
|
| 67 |
)
|
| 68 |
|
|
|
|
|
|
|
| 69 |
demo.launch(show_error=True)
|
|
|
|
| 3 |
from gradio_client import Client, handle_file
|
| 4 |
|
| 5 |
|
| 6 |
+
def infer(text_prompt, action_prompt, profile: gr.OAuthProfile):
|
| 7 |
+
print(profile)
|
| 8 |
|
| 9 |
inf_client = InferenceClient(
|
| 10 |
provider="replicate",
|
|
|
|
| 52 |
|
| 53 |
with gr.Column():
|
| 54 |
|
| 55 |
+
gr.LoginButton()
|
| 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 |
+
demo.load(
|
| 65 |
fn = infer,
|
| 66 |
+
inputs = [text_prompt, action_prompt],
|
| 67 |
outputs = [image_out, video_out]
|
| 68 |
)
|
| 69 |
|
| 70 |
+
|
| 71 |
+
|
| 72 |
demo.launch(show_error=True)
|