chore: improve async
This commit is contained in:
parent
74daa15ce7
commit
0aacbcaccb
2 changed files with 7 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
|
import nest_asyncio
|
||||||
import streamlit as st
|
import streamlit as st
|
||||||
|
|
||||||
from open_notebook.domain.models import DefaultModels, model_manager
|
from open_notebook.domain.models import DefaultModels, model_manager
|
||||||
|
|
@ -8,6 +9,8 @@ from open_notebook.graphs.ask import graph as ask_graph
|
||||||
from pages.components.model_selector import model_selector
|
from pages.components.model_selector import model_selector
|
||||||
from pages.stream_app.utils import convert_source_references, setup_page
|
from pages.stream_app.utils import convert_source_references, setup_page
|
||||||
|
|
||||||
|
nest_asyncio.apply()
|
||||||
|
|
||||||
setup_page("🔍 Search")
|
setup_page("🔍 Search")
|
||||||
|
|
||||||
ask_tab, search_tab = st.tabs(["Ask Your Knowledge Base (beta)", "Search"])
|
ask_tab, search_tab = st.tabs(["Ask Your Knowledge Base (beta)", "Search"])
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
|
import nest_asyncio
|
||||||
import streamlit as st
|
import streamlit as st
|
||||||
import streamlit_scrollable_textbox as stx # type: ignore
|
|
||||||
from humanize import naturaltime
|
from humanize import naturaltime
|
||||||
|
|
||||||
from open_notebook.domain.models import model_manager
|
from open_notebook.domain.models import model_manager
|
||||||
|
|
@ -10,6 +10,8 @@ from open_notebook.domain.transformation import Transformation
|
||||||
from open_notebook.graphs.transformation import graph as transform_graph
|
from open_notebook.graphs.transformation import graph as transform_graph
|
||||||
from pages.stream_app.utils import check_models
|
from pages.stream_app.utils import check_models
|
||||||
|
|
||||||
|
nest_asyncio.apply()
|
||||||
|
|
||||||
|
|
||||||
def source_panel(source_id: str, notebook_id=None, modal=False):
|
def source_panel(source_id: str, notebook_id=None, modal=False):
|
||||||
check_models(only_mandatory=False)
|
check_models(only_mandatory=False)
|
||||||
|
|
@ -100,4 +102,4 @@ def source_panel(source_id: str, notebook_id=None, modal=False):
|
||||||
|
|
||||||
with source_tab:
|
with source_tab:
|
||||||
st.subheader("Content")
|
st.subheader("Content")
|
||||||
stx.scrollableTextbox(source.full_text, height=300)
|
st.markdown(source.full_text)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue