Spaces:
Sleeping
Sleeping
File size: 1,812 Bytes
7ba3e2e b218760 7ba3e2e 73a012a 7ba3e2e |
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 54 55 |
import asyncio
import streamlit as st
import sqlite3
server_ports = []
client_ports = []
db = sqlite3.connect('chat-hub.db')
cursor = db.cursor()
cursor.execute('CREATE TABLE IF NOT EXISTS messages (id INTEGER PRIMARY KEY AUTOINCREMENT, sender TEXT, message TEXT, timestamp TEXT)')
db.commit()
# Inicjalizacja danych w st.session_state
if "server_ports" not in st.session_state:
st.session_state['server_ports'] = ""
if "client_ports" not in st.session_state:
st.session_state['client_ports'] = ""
if "user_ID" not in st.session_state:
st.session_state.user_ID = ""
if "gradio_Port" not in st.session_state:
st.session_state.gradio_Port = ""
if "server" not in st.session_state:
st.session_state.server = False
if "client" not in st.session_state:
st.session_state.client = False
st.set_page_config(layout="wide")
async def main():
st.title("NeuralGPT")
gradio_Ports = st.container(border=True)
gradio_Ports.markdown(st.session_state.gradio_Port)
with st.sidebar:
# Wyświetlanie danych, które mogą być modyfikowane na różnych stronach
serverPorts = st.container(border=True)
serverPorts.markdown(st.session_state['server_ports'])
st.text("Client ports")
clientPorts = st.container(border=True)
clientPorts.markdown(st.session_state['client_ports'])
st.text("Character.ai ID")
user_id = st.container(border=True)
user_id.markdown(st.session_state.user_ID)
status = st.status(label="runs", state="complete", expanded=False)
if st.session_state.server == True:
st.markdown("server running...")
if st.session_state.client == True:
st.markdown("client running")
# Uruchomienie aplikacji
asyncio.run(main()) |