Skip to content

Commit f0c5448

Browse files
committed
Tetes with Llama.cpp and teh Elevenlabs extension. Woking, but there are memory issues and many other issues.
1 parent ff4f708 commit f0c5448

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

extensions/elevenlabs_tts/script.py

-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ def refresh_voices():
3838
if client is None:
3939
client = update_api_key(params['api_key'])
4040
response = client.voices.get_all(show_legacy=True)
41-
female_voices = [voice for voice in response.voices if voice.labels.get('gender') == 'female']
4241
print(f"Available voices: {female_voices}")
43-
voice_names = [voice.name for voice in female_voices]
4442
return voice_names
4543

4644
def refresh_voices_dd():

modules/block_requests.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,27 @@ def my_get(url, **kwargs):
4040

4141
# Kindly provided by our friend WizardLM-30B
4242
def my_open(*args, **kwargs):
43-
"""
44-
Custom open function that modifies the file contents before returning.
45-
"""
4643
filename = str(args[0])
4744
if filename.endswith("index.html"):
4845
with original_open(*args, **kwargs) as f:
4946
file_contents = f.read()
5047

48+
file_contents = file_contents if isinstance(file_contents, str) else file_contents.decode('utf-8')
5149
file_contents = file_contents.replace(
52-
b'\t\t<script\n\t\t\tsrc="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.9/iframeResizer.contentWindow.min.js"\n\t\t\tasync\n\t\t></script>',
53-
b''
50+
'\t\t<script\n\t\t\tsrc="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.9/iframeResizer.contentWindow.min.js"\n\t\t\tasync\n\t\t></script>',
51+
''
5452
)
55-
file_contents = file_contents.replace(b"cdnjs.cloudflare.com", b"127.0.0.1")
53+
file_contents = file_contents.replace("cdnjs.cloudflare.com", "127.0.0.1")
5654
file_contents = file_contents.replace(
5755
'</head>',
5856
'\n <script src="file/js/katex/katex.min.js"></script>'
5957
'\n <script src="file/js/katex/auto-render.min.js"></script>'
6058
'\n <script src="file/js/highlightjs/highlight.min.js"></script>'
6159
'\n <script src="file/js/highlightjs/highlightjs-copy.min.js"></script>'
62-
f'\n <link id="highlight-css" rel="stylesheet" href="file/css/highlightjs/{"github-dark" if shared.settings["dark_theme"] else "github"}.min.css">'
6360
'\n <script>hljs.addPlugin(new CopyButtonPlugin());</script>'
6461
'\n </head>'
6562
)
63+
file_contents = file_contents.encode('utf-8')
6664

6765
return io.BytesIO(file_contents) # return bytes
6866
else:

modules/text_generation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def set_manual_seed(seed):
233233
torch.cuda.manual_seed_all(seed)
234234
elif is_torch_xpu_available():
235235
torch.xpu.manual_seed_all(seed)
236-
# torch.xpu.manual_seed_all does not exist.
236+
# torch.npu.manual_seed_all does not exist.
237237
# elif is_torch_npu_available():
238238
# torch.npu.manual_seed_all(seed)
239239

0 commit comments

Comments
 (0)