-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separated widgets, all callbacks work
- Loading branch information
Showing
13 changed files
with
370 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ __pycache__ | |
.ipynb_checkpoints | ||
.DS_Store | ||
testing.ipynb | ||
.vscode | ||
.vscode | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
from datachad.streamlit.helper import ( | ||
authentication_and_options_side_bar, | ||
chat_interface, | ||
initialize_session_state, | ||
from datachad.streamlit.helper import init_session_state | ||
from datachad.streamlit.widgets import ( | ||
advanced_options_widget, | ||
authentication_widget, | ||
chat_interface_widget, | ||
init_widgets, | ||
page_header, | ||
upload_data_source, | ||
usage_side_bar, | ||
vector_store_selection, | ||
select_data_source_widget, | ||
usage_widget, | ||
) | ||
|
||
init_session_state() | ||
page_header() | ||
initialize_session_state() | ||
authentication_and_options_side_bar() | ||
upload_data_source() | ||
vector_store_selection() | ||
chat_interface() | ||
usage_side_bar() | ||
init_widgets() | ||
authentication_widget() | ||
select_data_source_widget() | ||
advanced_options_widget() | ||
chat_interface_widget() | ||
usage_widget() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
import logging | ||
import sys | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def configure_logger(debug: int = 0) -> None: | ||
# boilerplate code to enable logging in the streamlit app console | ||
log_level = logging.DEBUG if debug == 1 else logging.INFO | ||
logger.setLevel(log_level) | ||
|
||
stream_handler = logging.StreamHandler(stream=sys.stdout) | ||
stream_handler.setLevel(log_level) | ||
|
||
formatter = logging.Formatter("%(name)s :: %(levelname)s :: %(message)s") | ||
|
||
stream_handler.setFormatter(formatter) | ||
|
||
logger.addHandler(stream_handler) | ||
def create_logger(level="DEBUG"): | ||
logger = logging.getLogger(__name__) | ||
logger.propagate = False | ||
|
||
|
||
configure_logger(0) | ||
logger.setLevel(level) | ||
# if no streamhandler present, add one | ||
if not any( | ||
isinstance(handler, logging.StreamHandler) for handler in logger.handlers | ||
): | ||
stream_handler = logging.StreamHandler(stream=sys.stdout) | ||
formatter = logging.Formatter("%(name)s :: %(levelname)s :: %(message)s") | ||
stream_handler.setFormatter(formatter) | ||
logger.addHandler(stream_handler) | ||
return logger | ||
|
||
|
||
logger = create_logger() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.