Spaces:
Runtime error
Runtime error
Commit
·
05182fb
1
Parent(s):
ba49b3c
fix auth
Browse files
app.py
CHANGED
@@ -139,7 +139,8 @@ def create_speech_openai(chunk_idx, input, model='tts-1', voice='alloy', speed=1
|
|
139 |
|
140 |
# %% app.ipynb 11
|
141 |
def create_speech2(input_text, model='tts-1', voice='alloy', profile: gr.OAuthProfile|None=None, progress=gr.Progress(), **kwargs):
|
142 |
-
|
|
|
143 |
start = datetime.now()
|
144 |
# Split the input text into chunks
|
145 |
chunks = split_text(input_text)
|
@@ -174,7 +175,7 @@ def create_speech2(input_text, model='tts-1', voice='alloy', profile: gr.OAuthPr
|
|
174 |
|
175 |
# %% app.ipynb 12
|
176 |
def create_speech(input_text, model='tts-1', voice='alloy', profile: gr.OAuthProfile|None=None, progress=gr.Progress()):
|
177 |
-
assert authorized(
|
178 |
# Split the input text into chunks
|
179 |
chunks = split_text(input_text)
|
180 |
|
@@ -231,7 +232,7 @@ def get_generation_cost(input_text, tts_model_dropdown):
|
|
231 |
|
232 |
# %% app.ipynb 15
|
233 |
def authorized(profile: gr.OAuthProfile=None) -> str:
|
234 |
-
print(profile)
|
235 |
if profile in ["matdmiller"]:
|
236 |
return f"{profile.username}"
|
237 |
return None
|
|
|
139 |
|
140 |
# %% app.ipynb 11
|
141 |
def create_speech2(input_text, model='tts-1', voice='alloy', profile: gr.OAuthProfile|None=None, progress=gr.Progress(), **kwargs):
|
142 |
+
print('cs2-profile:',profile)
|
143 |
+
assert authorized() is not None,'Unauthorized M'
|
144 |
start = datetime.now()
|
145 |
# Split the input text into chunks
|
146 |
chunks = split_text(input_text)
|
|
|
175 |
|
176 |
# %% app.ipynb 12
|
177 |
def create_speech(input_text, model='tts-1', voice='alloy', profile: gr.OAuthProfile|None=None, progress=gr.Progress()):
|
178 |
+
assert authorized() is not None,'Unauthorized M'
|
179 |
# Split the input text into chunks
|
180 |
chunks = split_text(input_text)
|
181 |
|
|
|
232 |
|
233 |
# %% app.ipynb 15
|
234 |
def authorized(profile: gr.OAuthProfile=None) -> str:
|
235 |
+
print('Profile:', profile)
|
236 |
if profile in ["matdmiller"]:
|
237 |
return f"{profile.username}"
|
238 |
return None
|