Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
c6c298b4
"docs/vscode:/vscode.git/clone" did not exist on "94b27fb8da1002a560449f4b8c0fc92e22115c40"
Unverified
Commit
c6c298b4
authored
Jul 20, 2024
by
Justin Hayes
Committed by
GitHub
Jul 20, 2024
Browse files
Fetch didn't happen
parent
6cecb964
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
backend/apps/audio/main.py
backend/apps/audio/main.py
+3
-3
src/lib/components/admin/Settings/Audio.svelte
src/lib/components/admin/Settings/Audio.svelte
+4
-4
No files found.
backend/apps/audio/main.py
View file @
c6c298b4
...
...
@@ -134,7 +134,7 @@ def convert_mp4_to_wav(file_path, output_path):
print
(
f
"Converted
{
file_path
}
to
{
output_path
}
"
)
async
def
f
et
ch
_available_voices
():
async
def
g
et_available_voices
():
if
app
.
state
.
config
.
TTS_ENGINE
!=
"elevenlabs"
:
return
{}
...
...
@@ -289,7 +289,7 @@ async def speech(request: Request, user=Depends(get_verified_user)):
log
.
exception
(
e
)
raise
HTTPException
(
status_code
=
400
,
detail
=
"Invalid JSON payload"
)
voice_options
=
await
f
et
ch
_available_voices
()
voice_options
=
await
g
et_available_voices
()
voice_id
=
voice_options
.
get
(
payload
[
'voice'
])
if
not
voice_id
:
...
...
@@ -474,5 +474,5 @@ def transcribe(
@
app
.
get
(
"/voices"
)
async
def
get_voices
(
user
=
Depends
(
get_verified_user
)):
voices
=
await
f
et
ch
_available_voices
()
voices
=
await
g
et_available_voices
()
return
{
"voices"
:
list
(
voices
.
keys
())}
src/lib/components/admin/Settings/Audio.svelte
View file @
c6c298b4
...
...
@@ -57,7 +57,7 @@
};
// Fetch available ElevenLabs voices
const
f
et
chAvailable
Voices = async () => {
const
g
etVoices = async () => {
const response = await fetch('/voices', {
method: 'GET',
headers: {
...
...
@@ -100,7 +100,7 @@
onMount(async () => {
// Fetch available voices on component mount
await
f
et
chAvailable
Voices();
await
g
etVoices();
const res = await getAudioConfig(localStorage.token);
...
...
@@ -125,7 +125,7 @@
getOpenAIVoices();
getOpenAIModels();
} else if(TTS_ENGINE === 'elevenlabs') {
await
f
et
chAvailable
Voices(); //
Fetch
voices if TTS_ENGINE is ElevenLabs
await
g
etVoices(); //
Get
voices if TTS_ENGINE is ElevenLabs
} else {
getWebAPIVoices();
}
...
...
@@ -213,7 +213,7 @@
TTS_VOICE = 'alloy';
TTS_MODEL = 'tts-1';
} else if(e.target.value === 'elevenlabs') {
await
f
et
chAvailable
Voices();
await
g
etVoices();
} else {
getWebAPIVoices();
TTS_VOICE = '';
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment