import gradio as gr from functools import partial from get_similar_profiles import get_similar_profiles from cohort_members import cohort_data from tech_stuff import prefix import os title = "EF AI Co-Finder 👀" with gr.Blocks(title=title,theme='nota-ai/theme') as demo: gr.Markdown(f"# {title}") with gr.Tab("Main app"): with gr.Row(): with gr.Column(scale = 10): profile_selector = gr.Dropdown(cohort_data.keys(), label="Select profile") with gr.Column(scale = 2): nb_to_display = gr.Number(value=10,label = "Number of profiles to show") search_button = gr.Button(value="Find a match 🏹") similar_profiles = gr.Markdown("Empty") with gr.Tab("Geeks area 🤖🛠️"): gr.Markdown("# Config and tech details") prefix = gr.Textbox(value=prefix, lines=1, label="Change here the prefix appended to each profile to steer the similarity search") search_function = partial(get_similar_profiles) search_button.click(fn=search_function, inputs=[profile_selector, prefix,nb_to_display], outputs=[similar_profiles], ) login = os.environ.get("login") pwd = os.environ.get("pwd") demo.launch demo.launch(max_threads=40,auth=(login,pwd))