File size: 2,277 Bytes
d0a793d
 
 
c40a23d
d0a793d
7897136
d0a793d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ba12e94
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
50
51
52
53
import gradio as gr
from functools import partial
import subprocess
from get_complementary_profiles import get_similar_profiles
from simulator import simulate
from cohort_members_uk_paris import cohort_data
from tech_stuff import prefix,system_prompt, how_does_it_work
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("Co-finder"):
        with gr.Row():
            with gr.Column(scale = 10):
                profile_selector = gr.Dropdown(cohort_data.keys(), label="Select a 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("Co-founder Simulator"):        
        with gr.Row():
            with gr.Column(scale = 10):
                profile_selector_1 = gr.Dropdown(cohort_data.keys(), label="Select a profile")
            with gr.Column(scale = 10):
                profile_selector_2 = gr.Dropdown(cohort_data.keys(), label="Select another profile")
            simulator_button = gr.Button(value="Simulate ๐ŸŽฎ")
        simulation_output = gr.Markdown("Empty")
        
    with gr.Tab("Geeks area ๐Ÿค–๐Ÿ› ๏ธ"):
        gr.Markdown("# Config and tech details")
        prefix_input =  gr.Textbox(value=prefix, lines=10, label="Change here the prefix appended to each profile to steer the similarity search")
        system_prompt_input =  gr.Textbox(value=system_prompt, lines=10, label="Change here the prompt used for the simulation")
        
        gr.Markdown("## How does it work?")
        gr.Markdown(how_does_it_work)
            
            
    search_function = partial(get_similar_profiles)
    simulate_function = partial(simulate)

    search_button.click(fn=search_function, inputs=[profile_selector, prefix_input,nb_to_display], outputs=[similar_profiles])
    simulator_button.click(fn=simulate_function, inputs=[profile_selector_1, profile_selector_2, system_prompt_input], outputs = [simulation_output])

login = os.environ.get("login")
pwd = os.environ.get("pwd")
demo.launch(max_threads=40)