theFisher86 commited on
Commit
de28a32
1 Parent(s): 556e22a

Update app.py

Browse files

changed the whole thing around with help from copilott

Files changed (1) hide show
  1. app.py +24 -13
app.py CHANGED
@@ -19,18 +19,29 @@ response = requests.post(url, json=payload, headers=headers)
19
  print(response.text)
20
 
21
  #Copilot Stuff
22
- #import gradio as gr
23
-
24
- # Define the Gradio interface
25
- description = "Upload and download files"
26
- title = "Upload and Download"
27
- interface = gr.Interface(
28
- fn=None, # We don't need a function for this example
29
- BodyInput=gr.File(label="Upload Body Picture"),
30
- FaceInput=gr.File(label="Upload Face Picture"),
31
- title=title,
32
- description=description
 
 
 
 
 
 
 
 
 
 
 
33
  )
34
 
35
- # Launch the Gradio app
36
- interface.launch()
 
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()