Update app.py
Browse files
app.py
CHANGED
|
@@ -9,15 +9,29 @@ from logger import log_enabled
|
|
| 9 |
from app_chat import app_chat
|
| 10 |
import numpy as np
|
| 11 |
import re,sys,unicodedata
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
from app_agent_config import AgentConfig
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
st.set_page_config(
|
| 16 |
page_title="Custom Transformers can realy do anything...",
|
| 17 |
page_icon="👋",
|
| 18 |
)
|
| 19 |
-
# Create an instance of AgentConfig
|
| 20 |
-
agent_config = AgentConfig()
|
| 21 |
|
| 22 |
#####
|
| 23 |
def on_close():
|
|
@@ -27,7 +41,7 @@ def on_close():
|
|
| 27 |
def open_modal():
|
| 28 |
st.modal("User Guide", "app_user_desc()")
|
| 29 |
|
| 30 |
-
st.button("User Description", open_modal)
|
| 31 |
# Define a callback function that will be called when the button is clicked
|
| 32 |
#def open_modal():
|
| 33 |
# st.modal("User Guide", app_user_desc())
|
|
|
|
| 9 |
from app_chat import app_chat
|
| 10 |
import numpy as np
|
| 11 |
import re,sys,unicodedata
|
| 12 |
+
import logging
|
| 13 |
+
##################################### logger #################################
|
| 14 |
+
|
| 15 |
+
logger.remove()
|
| 16 |
+
logger.add(
|
| 17 |
+
sys.stderr,
|
| 18 |
+
colorize=True,
|
| 19 |
+
format="<green>{time:HH:mm:ss}</green> | <level>{message}</level>",
|
| 20 |
+
level=10,
|
| 21 |
+
)
|
| 22 |
+
logger.add("log.log", rotation="1 MB", level="DEBUG", compression="zip")
|
| 23 |
+
|
| 24 |
|
| 25 |
from app_agent_config import AgentConfig
|
| 26 |
|
| 27 |
+
# Create an instance of AgentConfig ## holds all data and settings
|
| 28 |
+
agent_config = AgentConfig()
|
| 29 |
+
|
| 30 |
+
|
| 31 |
st.set_page_config(
|
| 32 |
page_title="Custom Transformers can realy do anything...",
|
| 33 |
page_icon="👋",
|
| 34 |
)
|
|
|
|
|
|
|
| 35 |
|
| 36 |
#####
|
| 37 |
def on_close():
|
|
|
|
| 41 |
def open_modal():
|
| 42 |
st.modal("User Guide", "app_user_desc()")
|
| 43 |
|
| 44 |
+
st.button("User Description", open_modal())
|
| 45 |
# Define a callback function that will be called when the button is clicked
|
| 46 |
#def open_modal():
|
| 47 |
# st.modal("User Guide", app_user_desc())
|