Spaces:
Runtime error
Runtime error
sandrocalzada
commited on
Commit
•
0e2ee45
1
Parent(s):
d7549f8
Update app.py
Browse files
app.py
CHANGED
@@ -1,55 +1,41 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
-
import
|
4 |
-
|
5 |
-
def
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
title="Análisis automático de CV",
|
43 |
-
description="Esta aplicación analiza un CV para determinar la elegibilidad para un rol específico basado en la experiencia y expectativas salariales. Por favor, proporciona el CV, el rol deseado y la expectativa salarial.",
|
44 |
-
theme="dark",
|
45 |
-
css="""
|
46 |
-
body { font-family: 'Arial'; }
|
47 |
-
.gr-input-text { border-color: #007BFF; }
|
48 |
-
.gr-file { border-color: #007BFF; }
|
49 |
-
.gr-button { background-color: #007BFF; color: white; }
|
50 |
-
.gr-output-text { font-size: 16px; }
|
51 |
-
"""
|
52 |
-
)
|
53 |
-
|
54 |
-
# Launch the application with share=True to create a public link
|
55 |
-
iface.launch(share=True)
|
|
|
1 |
import gradio as gr
|
2 |
+
import pandas as pd
|
3 |
+
import openpyxl
|
4 |
+
|
5 |
+
def upload_excel(file):
|
6 |
+
try:
|
7 |
+
df = pd.read_excel(file.name)
|
8 |
+
return df.to_html(index=False)
|
9 |
+
except Exception as e:
|
10 |
+
return f"Error: {str(e)}"
|
11 |
+
|
12 |
+
def process_excel(file):
|
13 |
+
return "Processing complete! This is a placeholder message."
|
14 |
+
|
15 |
+
def display_output():
|
16 |
+
return "Displaying output! This is a placeholder message."
|
17 |
+
|
18 |
+
def launch():
|
19 |
+
with gr.Blocks(css=".upload-button { width: 100%; } .process-button { width: 100%; }") as demo:
|
20 |
+
gr.Markdown("<h1 style='text-align: center;'>Excel Processor App</h1>")
|
21 |
+
|
22 |
+
with gr.Row():
|
23 |
+
with gr.Column():
|
24 |
+
gr.Markdown("## Upload Excel File")
|
25 |
+
file_input = gr.File(label="")
|
26 |
+
upload_button = gr.Button("Upload", elem_id="upload-button")
|
27 |
+
excel_output = gr.HTML(label="Excel Content")
|
28 |
+
|
29 |
+
with gr.Column():
|
30 |
+
gr.Markdown("## Process and Output")
|
31 |
+
process_button = gr.Button("Process", elem_id="process-button")
|
32 |
+
text_output = gr.Textbox(label="Output", interactive=False)
|
33 |
+
|
34 |
+
upload_button.click(upload_excel, inputs=file_input, outputs=excel_output)
|
35 |
+
process_button.click(process_excel, inputs=file_input, outputs=text_output)
|
36 |
+
process_button.click(display_output, inputs=None, outputs=text_output)
|
37 |
+
|
38 |
+
demo.launch()
|
39 |
+
|
40 |
+
if __name__ == "__main__":
|
41 |
+
launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|