Spaces:
Runtime error
Runtime error
File size: 2,136 Bytes
b8ac4f2 6c13188 b8ac4f2 6c13188 b8ac4f2 6c13188 b8ac4f2 6c13188 b8ac4f2 adb1c6d b8296e5 adb1c6d 6c13188 b8296e5 adb1c6d 6c13188 5a3b22b b8296e5 5a3b22b b8296e5 adb1c6d 6c13188 adb1c6d |
1 2 3 4 5 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 43 44 45 46 47 48 49 |
import gradio as gr
def analyze_cv(cv_file, desired_role, expected_salary):
# Define salary ranges for different roles (this is just an example)
salary_ranges = {
"Desarrollador": (30000, 60000),
"Dise帽ador": (25000, 50000),
"Gerente": (40000, 80000)
}
# Read the content of the CV
cv_content = cv_file.read().decode("utf-8").lower()
# Check if the desired role is mentioned in the CV
if desired_role.lower() in cv_content:
# Check if the expected salary is within the range for the role
salary_range = salary_ranges.get(desired_role, (0, 0))
if salary_range[0] <= int(expected_salary) <= salary_range[1]:
result = "El candidato es elegible para la posici贸n."
else:
result = "El candidato no es elegible debido a las expectativas salariales."
else:
result = "El candidato no es elegible debido a la falta de experiencia relevante."
return result
# Define the Gradio interface with aesthetic enhancements
iface = gr.Interface(
fn=analyze_cv,
inputs=[
gr.File(label="Sube tu CV"),
gr.Textbox(label="Nombre del rol o posici贸n deseada", placeholder="Ejemplo: Desarrollador"),
gr.Textbox(label="Salario esperado", placeholder="Ejemplo: 50000"),
],
outputs=gr.Textbox(label="Resultado de la elegibilidad"),
title="<img src='https://static.vecteezy.com/system/resources/previews/026/608/082/non_2x/cv-analysis-icon-flat-vector.jpg' style='max-height: 50px;'> Nombre de la Aplicaci贸n",
description="Esta aplicaci贸n analiza tu CV para determinar tu elegibilidad para un rol espec铆fico basado en tu experiencia y expectativas salariales. Por favor, proporciona tu CV, el rol deseado y tu expectativa salarial.",
theme="dark", # Example theme
css="""
body { font-family: 'Arial'; }
.gr-input-text { border-color: #007BFF; }
.gr-file { border-color: #007BFF; }
.gr-button { background-color: #007BFF; color: white; }
.gr-output-text { font-size: 16px; }
"""
)
# Launch the application
iface.launch() |