Skip to content

Commit

Permalink
Add note -- only show for non-paying and non-admin users
Browse files Browse the repository at this point in the history
  • Loading branch information
nikochiko committed Oct 12, 2023
1 parent 6eb75c1 commit cb71576
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion daras_ai_v2/text_to_speech_settings_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class TextToSpeechProviders(Enum):
}


def text_to_speech_settings():
def text_to_speech_settings(page=None):
st.write(
"""
##### 🗣️ Voice Settings
Expand Down Expand Up @@ -226,6 +226,12 @@ def text_to_speech_settings():

case TextToSpeechProviders.ELEVEN_LABS.name:
with col2:
if not (
page
and (page.is_current_user_paying() or page.is_current_user_admin())
):
st.caption("Note: Eleven Labs is only available for paying users.")

st.selectbox(
"""
###### Voice name (ElevenLabs)
Expand Down
2 changes: 1 addition & 1 deletion recipes/TextToSpeech.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def validate_form_v2(self):
assert st.session_state["text_prompt"], "Text input cannot be empty"

def render_settings(self):
text_to_speech_settings()
text_to_speech_settings(page=self)

def get_raw_price(self, state: dict):
tts_provider = self._get_tts_provider(state)
Expand Down
2 changes: 1 addition & 1 deletion recipes/VideoBots.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def render_settings(self):
st.write("---")
st.session_state["tts_provider"] = None
else:
text_to_speech_settings()
text_to_speech_settings(page=self)

st.write("---")
if not "__enable_video" in st.session_state:
Expand Down

0 comments on commit cb71576

Please sign in to comment.