File size: 2,094 Bytes
5c01b87
711c0ff
2b61c31
5c01b87
2b61c31
 
18d7aec
5f0b3bb
5a5d6f8
18d7aec
5f0b3bb
509213c
 
b0bbce0
 
2b61c31
0804c9d
711c0ff
36f2148
53c470b
 
 
36f2148
ea8f244
bb1c140
295a917
 
 
8994f4e
 
bb1c140
 
 
 
 
ea8f244
 
 
d66d33e
ea8f244
5c01b87
 
711c0ff
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
import gradio as gr
import gen
import psychohistory

with gr.Blocks(title="PSYCHOHISTORY") as app:
    with gr.Tab("Search"):
        with gr.Row():
            model = gr.Radio(["Gemma2", "Zephy7B"], value="Gemma2",label="Model", info="Select model",scale=2)
            time_direction = gr.Radio(["Past", "Future"],value="Future", label="Direction", info="Select time direction",scale=2)
            num_fut = gr.Textbox(value="4", label="Future Steps", scale=2)
            with gr.Column():
                
                spaces_include = gr.Checkbox(label="Hight", value=True,info="Probabilities")
                spaces_include = gr.Checkbox(label="Medium", value=True)
                spaces_include = gr.Checkbox(label="Low", value=True)
        with gr.Row():
            txt_search = gr.Textbox(value="Peace in Eurasia in 2027", label="Search Term", scale=5)
            btn_search = gr.Button("Look", scale=1)
        with gr.Row():
            img_output = gr.Image(label="Global Graph ", type="filepath")  # Add an Image component
            img_output2 = gr.Image(label="Most likely", type="filepath")
            img_output3 = gr.Image(label="The slowest", type="filepath")
            # Trigger graph generation after JSON is generated

        with gr.Row():
            mem_results = gr.JSON(label="Predicted Futures",scale=2) # Futures predicted
            mem_results2 = gr.JSON(label="Radians Slow Path",scale=1)
            mem_results3 = gr.JSON(label="Radians Best Path",scale=1)
            #counter_results = gr.JSON(label="Counter Activity") # Wich activities are against the event
            #dark_results = gr.JSON(label="Dark Forces") #Who makes not happend
            btn_search.click(
                gen.generate,
                inputs=[txt_search],
                outputs=mem_results
            )
            mem_results.change(
                psychohistory.main,
                inputs=[mem_results],
                outputs=[img_output,img_output2,img_output3]#,mem_results2,mem_results3]
            )

if __name__ == "__main__":
    app.launch()