Skip to content

Commit

Permalink
feat: display warning about usage tiers when a different model that d…
Browse files Browse the repository at this point in the history
…efault is chosen
  • Loading branch information
sudoleg committed Apr 6, 2024
1 parent 4f1e26c commit bbd6c0c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def display_error_message(message: str):


def display_warning_message(message: str):
st.warning(message, icon=":warning:")
st.warning(message)


def display_sidebar():
Expand All @@ -70,7 +70,7 @@ def display_sidebar():
"""
with st.sidebar:
st.header("(Advanced) settings", divider="rainbow")
st.selectbox(
model = st.selectbox(
"Select a model",
get_available_models(),
key="model",
Expand All @@ -90,11 +90,15 @@ def display_sidebar():
help=get_default_config_value("help_texts.saving_responses"),
key="save_responses",
)
if model != get_default_config_value("default_model"):
display_warning_message(
":warning: Make sure that you have at least Tier 1, as GPT-4 (turbo) is not available in the free tier. See https://platform.openai.com/docs/guides/rate-limits/usage-tiers"
)


def main():
st.set_page_config(
"Video summarizer", layout="wide", initial_sidebar_state="collapsed"
page_title="YouTube AI", layout="wide", initial_sidebar_state="auto"
)
# it's recommended to explicitly set session_state vars initially
if "model" not in st.session_state:
Expand Down

0 comments on commit bbd6c0c

Please sign in to comment.