Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| def generate_cv( | |
| email, | |
| date_of_birth, | |
| mbti, | |
| sustainable_dev_goals, | |
| via_strength_1, | |
| via_strength_2, | |
| via_strength_3, | |
| via_strength_4, | |
| via_strength_5, | |
| disc_d, | |
| disc_i, | |
| disc_s, | |
| disc_c, | |
| big5_extroversion, | |
| big5_emotional_stability, | |
| big5_agreeableness, | |
| big5_conscientiousness, | |
| big5_intellect, | |
| past_project, | |
| influences, | |
| main_passions, | |
| preferred_location, | |
| ideal_work_environment, | |
| productive_time, | |
| partner_qualities, | |
| vision | |
| ): | |
| """ | |
| Generates a text-based CV with Markdown tables. | |
| Adjust the field order and names as needed. | |
| """ | |
| cv_text = f""" | |
| # CV Template | |
| ## Essential Information | |
| | Field | Details | | |
| |---------------------------------|-------------------------------------------------| | |
| | **Email Address** | {email} | | |
| | **Date of Birth** | {date_of_birth} | | |
| | **16 Personalities (MBTI)** | {mbti} | | |
| | **Sustainable Development Goals** | {sustainable_dev_goals} | | |
| | **VIA Strengths (Top 5)** | 1. {via_strength_1}<br>2. {via_strength_2}<br>3. {via_strength_3}<br>4. {via_strength_4}<br>5. {via_strength_5} | | |
| ## Personality Profile | |
| | Field | Details | | |
| |-------------------|---------------------------------------------------------------------------------------------------------| | |
| | **DISC (D, I, S, C)** | D: {disc_d}%<br>I: {disc_i}%<br>S: {disc_s}%<br>C: {disc_c}% | | |
| | **Big Five (OCEAN)** | Extroversion: {big5_extroversion}%<br>Emotional Stability: {big5_emotional_stability}%<br>Agreeableness: {big5_agreeableness}%<br>Conscientiousness: {big5_conscientiousness}%<br>Intellect/Imagination: {big5_intellect}% | | |
| ## Interests & Passions | |
| | Field | Details | | |
| |-------------------------------------------------|------------------------------------------| | |
| | **Past Project or Workplace You Loved (Why)** | {past_project} | | |
| | **People, Books, Courses, or Resources That Shaped You (Why)** | {influences} | | |
| | **Main Passions and Topics of Interest** | {main_passions} | | |
| ## Collaboration Preferences | |
| | Field | Details | | |
| |--------------------------------------------------|-------------------------------------------------| | |
| | **Preferred Country & Town for Meetups** | {preferred_location} | | |
| | **Ideal Work Environment** | {ideal_work_environment} | | |
| | **Most Productive Time of Day/Night** | {productive_time} | | |
| | **Qualities in an Ideal Partner (Professional/Personal)** | {partner_qualities} | | |
| | **Vision for Future Collaboration or Partnership** | {vision} | | |
| """ | |
| return cv_text.strip() | |
| # Create a Gradio interface that matches the function's parameter order | |
| demo = gr.Interface( | |
| fn=generate_cv, | |
| inputs=[ | |
| "text", # email | |
| "text", # date_of_birth | |
| "text", # mbti | |
| "text", # sustainable_dev_goals | |
| "text", # via_strength_1 | |
| "text", # via_strength_2 | |
| "text", # via_strength_3 | |
| "text", # via_strength_4 | |
| "text", # via_strength_5 | |
| "text", # disc_d | |
| "text", # disc_i | |
| "text", # disc_s | |
| "text", # disc_c | |
| "text", # big5_extroversion | |
| "text", # big5_emotional_stability | |
| "text", # big5_agreeableness | |
| "text", # big5_conscientiousness | |
| "text", # big5_intellect | |
| "text", # past_project | |
| "text", # influences | |
| "text", # main_passions | |
| "text", # preferred_location | |
| "text", # ideal_work_environment | |
| "text", # productive_time | |
| "text", # partner_qualities | |
| "text", # vision | |
| ], | |
| outputs="text", | |
| title="CV Template with Markdown Tables" | |
| ) | |
| demo.launch() |