Skip to content

Commit

Permalink
chore: remove cache spinner due to spinner conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
sean1832 committed Mar 17, 2023
1 parent dbbdf18 commit 2442b65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def language_base(string: str) -> str:
return 'other'


@st.cache_data()
@st.cache_data(show_spinner=False)
def extract_youtube_transcript(url: str, lang_code: str | List[str] = 'a.en') -> Tuple[str, str]:
"""Extracts the transcript from a YouTube video."""

Expand All @@ -143,7 +143,7 @@ def extract_youtube_transcript(url: str, lang_code: str | List[str] = 'a.en') ->
return transcript, title


@st.cache_data()
@st.cache_data(show_spinner=False)
def convert_to_chunks(content: str, chunk_size: int = 1000, enable_embedding: bool = False) -> List[Dict[str, float]]:
"""Converts a string into chunks of a given size."""
chunks_text = _chunk_spliter(content, chunk_size, language_base(content))
Expand Down Expand Up @@ -172,7 +172,7 @@ def search_chunks(query: str, chunks: List[Dict[str, float]], count: int = 1) ->
return ordered[0:count]


@st.cache_data()
@st.cache_data(show_spinner=False)
def recursive_summarize(chunks: List[Dict[str, Union[str, float]]], max_tokens) -> Tuple[List[str], str]:
"""Returns a recursive summary of the given content."""
recursiveSumTexts = []
Expand All @@ -193,7 +193,7 @@ def recursive_summarize(chunks: List[Dict[str, Union[str, float]]], max_tokens)
return recursiveSumTexts, finish_reason


@st.cache_data()
@st.cache_data(show_spinner=False)
def summarize(message: List[str] | str) -> Tuple[str, str]:
"""Returns a summary of the given content."""
if isinstance(message, list):
Expand Down

0 comments on commit 2442b65

Please sign in to comment.