Spaces:
Runtime error
Runtime error
theFisher86
commited on
Commit
•
de28a32
1
Parent(s):
556e22a
Update app.py
Browse fileschanged the whole thing around with help from copilott
app.py
CHANGED
@@ -19,18 +19,29 @@ response = requests.post(url, json=payload, headers=headers)
|
|
19 |
print(response.text)
|
20 |
|
21 |
#Copilot Stuff
|
22 |
-
|
23 |
-
|
24 |
-
#
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
)
|
34 |
|
35 |
-
# Launch the Gradio
|
36 |
-
|
|
|
19 |
print(response.text)
|
20 |
|
21 |
#Copilot Stuff
|
22 |
+
|
23 |
+
def process_files(file1, file2):
|
24 |
+
# Process the uploaded files (e.g., read content, perform calculations, etc.)
|
25 |
+
# Replace the following lines with your actual processing logic
|
26 |
+
#file1_content = file1.read().decode("utf-8")
|
27 |
+
#file2_content = file2.read().decode("utf-8")
|
28 |
+
#result = f"File 1 content:\n{file1_content}\n\nFile 2 content:\n{file2_content}"
|
29 |
+
result = "It worked"
|
30 |
+
return result
|
31 |
+
|
32 |
+
# Create a Gradio interface with two file upload components
|
33 |
+
iface = gr.Interface(
|
34 |
+
fn=process_files,
|
35 |
+
inputs=[
|
36 |
+
# gr.inputs.File(label="Upload File 1"),
|
37 |
+
# gr.inputs.File(label="Upload File 2")
|
38 |
+
gr.inputs.Image(label="Face File", value="FaceFile", interactive=True, show_share_button=True, container=True, type='filepath', source=('upload', 'webcam', 'clipboard')),
|
39 |
+
gr.inputs.Image(label="Body File", value="BodyFile", interactive=True, show_share_button=True, container=True, type='filepath', source=('upload', 'webcam', 'clipboard'))
|
40 |
+
],
|
41 |
+
outputs="text",
|
42 |
+
title="File Upload Interface",
|
43 |
+
description="Upload two files and process them."
|
44 |
)
|
45 |
|
46 |
+
# Launch the Gradio interface
|
47 |
+
iface.launch()
|