Spaces:
Running
Running
Commit
·
83ebe3c
1
Parent(s):
80edeaf
upd app
Browse files
app.py
CHANGED
@@ -44,14 +44,13 @@ def upload_files(files):
|
|
44 |
os.makedirs('uploads')
|
45 |
|
46 |
print('uploading files', files)
|
47 |
-
button = None
|
48 |
file_urls = []
|
49 |
for file in files:
|
50 |
file_urls.append(
|
51 |
-
f'
|
52 |
)
|
53 |
print(file_urls)
|
54 |
-
return file_urls
|
55 |
|
56 |
|
57 |
with gr.Blocks() as demo:
|
@@ -59,17 +58,16 @@ with gr.Blocks() as demo:
|
|
59 |
with gr.Row(equal_height=True):
|
60 |
with gr.Column():
|
61 |
gr.Markdown("### Input")
|
62 |
-
|
63 |
upload_button = gr.UploadButton("Upload Images", file_count='multiple', file_types=['image'])
|
64 |
hidden_files = gr.State([])
|
65 |
-
|
66 |
-
upload_button.upload(upload_files, upload_button, [hidden_files, download_button])
|
67 |
with gr.Column():
|
68 |
gr.Markdown("### Output")
|
69 |
output = gr.Textbox(lines=5, label="Output Text")
|
70 |
with gr.Row():
|
71 |
send_button = gr.Button("Send")
|
72 |
-
send_button.click(send_message, inputs=[
|
73 |
|
74 |
|
75 |
|
|
|
44 |
os.makedirs('uploads')
|
45 |
|
46 |
print('uploading files', files)
|
|
|
47 |
file_urls = []
|
48 |
for file in files:
|
49 |
file_urls.append(
|
50 |
+
f'https://philipp-zettl-easybits-fal-lora.hf.space/gradio_api/file={urllib.parse.quote_plus(file)}'
|
51 |
)
|
52 |
print(file_urls)
|
53 |
+
return file_urls
|
54 |
|
55 |
|
56 |
with gr.Blocks() as demo:
|
|
|
58 |
with gr.Row(equal_height=True):
|
59 |
with gr.Column():
|
60 |
gr.Markdown("### Input")
|
61 |
+
inpt = gr.Textbox(label="LoRA Key-Word")
|
62 |
upload_button = gr.UploadButton("Upload Images", file_count='multiple', file_types=['image'])
|
63 |
hidden_files = gr.State([])
|
64 |
+
upload_button.upload(upload_files, upload_button, hidden_files)
|
|
|
65 |
with gr.Column():
|
66 |
gr.Markdown("### Output")
|
67 |
output = gr.Textbox(lines=5, label="Output Text")
|
68 |
with gr.Row():
|
69 |
send_button = gr.Button("Send")
|
70 |
+
send_button.click(send_message, inputs=[inpt, hidden_files], outputs=[output])
|
71 |
|
72 |
|
73 |
|