Arcypojeb commited on
Commit
d18d460
1 Parent(s): 59196d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -55
app.py CHANGED
@@ -1,5 +1,9 @@
1
  import asyncio
2
  import streamlit as st
 
 
 
 
3
 
4
  servers = {}
5
  inputs = []
@@ -8,30 +12,50 @@ used_ports = []
8
  server_ports = []
9
  client_ports = []
10
 
 
 
 
 
 
 
11
  st.set_page_config(layout="wide")
12
 
13
- st.session_state.update(st.session_state)
 
 
14
 
15
- if 'active_page' not in st.session_state:
16
- st.session_state.active_page = 'NeuralGPT'
17
- if "sidebar" not in st.session_state:
18
- st.session_state.sidebar = True
19
- if "server_Ports" not in st.session_state:
20
- st.session_state['server_ports'] = False
21
- if "client_Ports" not in st.session_state:
22
- st.session_state['client_ports'] = False
23
- if "userID" not in st.session_state:
24
- st.session_state.userID = False
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
- st.sidebar.title("NeuralGPT")
27
- st.sidebar.info(
28
- """
29
- [GitHub](https://github.com/giswqs)
30
- """
31
- )
32
 
33
- async def main():
34
- st.text("Server ports:")
 
 
 
35
  serverPorts = st.sidebar.container(border=True)
36
  serverPorts.markdown(st.session_state['server_ports'])
37
  st.sidebar.text("Client ports")
@@ -39,40 +63,6 @@ async def main():
39
  clientPorts.markdown(st.session_state['client_ports'])
40
  st.sidebar.text("Charavter.ai ID")
41
  user_id = st.sidebar.container(border=True)
42
- user_id.markdown(st.session_state.userID)
43
-
44
- st.title("NeuralGPT")
45
-
46
- st.markdown(
47
- """
48
- This page is supposed to work as interface of a hierarchical cooperative multi-agent framework/platform called NeuralGPT
49
-
50
- """
51
- )
52
-
53
- st.info("Click on the left sidebar menu to navigate to the different apps.")
54
-
55
- st.subheader("shit goes in here")
56
- st.markdown(
57
- """
58
- The following stuff is totally random no need to think about it too much.
59
- """
60
- )
61
-
62
- row1_col1, row1_col2 = st.columns(2)
63
- with row1_col1:
64
-
65
- st.image("https://i.postimg.cc/gk0LXT5p/earth6.gif")
66
- st.image("https://i.postimg.cc/kM2d2NcZ/movie-18.gif")
67
- st.image("https://i.postimg.cc/8z5ccf7z/Screenshot-2022-03-02-21-27-22-566-com-google-android-youtube.jpg")
68
- st.image("https://i.postimg.cc/YqvTSppw/dh.gif")
69
- st.image("https://i.postimg.cc/7PdxPGhr/bandicam-2018-11-13-04-33-29-245.jpg")
70
-
71
- with row1_col2:
72
- st.image("https://i.postimg.cc/X7nw1tFT/Neural-GPT.gif")
73
- st.image("https://i.postimg.cc/qBwpKMVh/brain-cell-galaxy.jpg")
74
- st.image("https://i.postimg.cc/T1sdWCL2/pyth.png")
75
- st.image("https://i.postimg.cc/L8T5s9Gk/bandicam2023-02-0323-10-40-545-ezgif-com-speed.gif")
76
- st.image("https://i.postimg.cc/rF5zvCJP/clocks5.gif")
77
 
78
- asyncio.run(main())
 
1
  import asyncio
2
  import streamlit as st
3
+ import http.server
4
+ import socketserver
5
+
6
+ PORT = 8000
7
 
8
  servers = {}
9
  inputs = []
 
12
  server_ports = []
13
  client_ports = []
14
 
15
+ Handler = http.server.SimpleHTTPRequestHandler
16
+
17
+ with socketserver.TCPServer(("", PORT), Handler) as httpd:
18
+ print("serving at port", PORT)
19
+ httpd.serve_forever()
20
+
21
  st.set_page_config(layout="wide")
22
 
23
+ async def main():
24
+
25
+ st.session_state.update(st.session_state)
26
 
27
+ if "server_ports" not in st.session_state:
28
+ st.session_state['server_ports'] = ""
29
+ if "client_ports" not in st.session_state:
30
+ st.session_state['client_ports'] = ""
31
+ if "user_ID" not in st.session_state:
32
+ st.session_state.user_ID = ""
33
+ if "gradio_Port" not in st.session_state:
34
+ st.session_state.gradio_Port = ""
35
+ if "servers" not in st.session_state:
36
+ st.session_state.servers = None
37
+ if "server" not in st.session_state:
38
+ st.session_state.server = None
39
+ if "clients" not in st.session_state:
40
+ st.session_state.clients = None
41
+ if "api_key" not in st.session_state:
42
+ st.session_state.api_key = None
43
+ if "tokenChar" not in st.session_state:
44
+ st.session_state.tokenChar = None
45
+ if "charName" not in st.session_state:
46
+ st.session_state.charName = None
47
+ if "character_ID" not in st.session_state:
48
+ st.session_state.character_ID = None
49
 
50
+ if st.session_state.server == None:
51
+ st.session_state.active_page = 'clients'
52
+ else: st.session_state.active_page = 'servers'
 
 
 
53
 
54
+ st.title("NeuralGPT")
55
+
56
+ st.sidebar.text("Gradio app")
57
+ gradio_Ports = st.container(border=True)
58
+ gradio_Ports.markdown(st.session_state.gradio_Port)
59
  serverPorts = st.sidebar.container(border=True)
60
  serverPorts.markdown(st.session_state['server_ports'])
61
  st.sidebar.text("Client ports")
 
63
  clientPorts.markdown(st.session_state['client_ports'])
64
  st.sidebar.text("Charavter.ai ID")
65
  user_id = st.sidebar.container(border=True)
66
+ user_id.markdown(st.session_state.user_ID)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
+ asyncio.run(main())