mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-03-24 22:34:41 +01:00
Fix several typos
This commit is contained in:
parent
249861b65d
commit
2d141b54c5
|
|
@ -313,7 +313,7 @@ llama.cpp:
|
|||
--row-split Split the model by rows across GPUs. This may improve multi-gpu performance.
|
||||
--no-mmap Prevent mmap from being used.
|
||||
--mlock Force the system to keep the model in RAM.
|
||||
--no-kv-offload Do not offload the K, Q, V to the GPU. This saves VRAM but reduces the performance.
|
||||
--no-kv-offload Do not offload the K, Q, V to the GPU. This saves VRAM but reduces performance.
|
||||
--batch-size BATCH_SIZE Maximum number of prompt tokens to batch together when calling llama-server. This is the application level batch size.
|
||||
--ubatch-size UBATCH_SIZE Maximum number of prompt tokens to batch together when calling llama-server. This is the max physical batch size for computation (device level).
|
||||
--threads THREADS Number of threads to use.
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ Allows you to enter your inputs in chat mode using your microphone.
|
|||
To adjust your default settings, you can add the following to your settings.yaml file.
|
||||
|
||||
```
|
||||
whisper_stt-whipser_language: chinese
|
||||
whisper_stt-whipser_model: tiny
|
||||
whisper_stt-whisper_language: chinese
|
||||
whisper_stt-whisper_model: tiny
|
||||
whisper_stt-auto_submit: False
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,13 @@ input_hijack = {
|
|||
|
||||
# parameters which can be customized in settings.yaml of webui
|
||||
params = {
|
||||
'whipser_language': 'english',
|
||||
'whipser_model': 'small.en',
|
||||
'whisper_language': 'english',
|
||||
'whisper_model': 'small.en',
|
||||
'auto_submit': True
|
||||
}
|
||||
|
||||
startup_device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
||||
WHISPERMODEL = whisper.load_model(params['whipser_model'], device=startup_device)
|
||||
WHISPERMODEL = whisper.load_model(params['whisper_model'], device=startup_device)
|
||||
|
||||
|
||||
def chat_input_modifier(text, visible_text, state):
|
||||
|
|
@ -36,7 +36,7 @@ def chat_input_modifier(text, visible_text, state):
|
|||
return text, visible_text
|
||||
|
||||
|
||||
def do_stt(audio, whipser_language):
|
||||
def do_stt(audio, whisper_language):
|
||||
# use pydub to convert sample_rate and sample_width for whisper input
|
||||
dubaudio = AudioSegment.from_file(io.BytesIO(audio))
|
||||
dubaudio = dubaudio.set_channels(1)
|
||||
|
|
@ -46,20 +46,20 @@ def do_stt(audio, whipser_language):
|
|||
# same method to get the array as openai whisper repo used from wav file
|
||||
audio_np = np.frombuffer(dubaudio.raw_data, np.int16).flatten().astype(np.float32) / 32768.0
|
||||
|
||||
if len(whipser_language) == 0:
|
||||
if len(whisper_language) == 0:
|
||||
result = WHISPERMODEL.transcribe(audio=audio_np)
|
||||
else:
|
||||
result = WHISPERMODEL.transcribe(audio=audio_np, language=whipser_language)
|
||||
result = WHISPERMODEL.transcribe(audio=audio_np, language=whisper_language)
|
||||
return result["text"]
|
||||
|
||||
|
||||
def auto_transcribe(audio, auto_submit, whipser_language):
|
||||
def auto_transcribe(audio, auto_submit, whisper_language):
|
||||
if audio is None or audio == "":
|
||||
print("Whisper received no audio data")
|
||||
return "", ""
|
||||
audio_bytes = base64.b64decode(audio.split(',')[1])
|
||||
|
||||
transcription = do_stt(audio_bytes, whipser_language)
|
||||
transcription = do_stt(audio_bytes, whisper_language)
|
||||
if auto_submit:
|
||||
input_hijack.update({"state": True, "value": [transcription, transcription]})
|
||||
return transcription
|
||||
|
|
@ -78,7 +78,7 @@ def reload_whispermodel(whisper_model_name: str, whisper_language: str, device:
|
|||
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
||||
|
||||
WHISPERMODEL = whisper.load_model(whisper_model_name, device=device)
|
||||
params.update({"whipser_model": whisper_model_name})
|
||||
params.update({"whisper_model": whisper_model_name})
|
||||
if ".en" in whisper_model_name:
|
||||
whisper_language = "english"
|
||||
audio_update = gr.Audio.update(interactive=True)
|
||||
|
|
@ -96,8 +96,8 @@ def ui():
|
|||
with gr.Accordion("Settings", open=False):
|
||||
auto_submit = gr.Checkbox(label='Submit the transcribed audio automatically', value=params['auto_submit'])
|
||||
device_dropd = gr.Dropdown(label='Device', value=str(startup_device), choices=["cuda", "cpu", "none"])
|
||||
whisper_model_dropd = gr.Dropdown(label='Whisper Model', value=params['whipser_model'], choices=["tiny.en", "base.en", "small.en", "medium.en", "tiny", "base", "small", "medium", "large", "turbo"])
|
||||
whisper_language = gr.Dropdown(label='Whisper Language', value=params['whipser_language'], choices=["english", "chinese", "german", "spanish", "russian", "korean", "french", "japanese", "portuguese", "turkish", "polish", "catalan", "dutch", "arabic", "swedish", "italian", "indonesian", "hindi", "finnish", "vietnamese", "hebrew", "ukrainian", "greek", "malay", "czech", "romanian", "danish", "hungarian", "tamil", "norwegian", "thai", "urdu", "croatian", "bulgarian", "lithuanian", "latin", "maori", "malayalam", "welsh", "slovak", "telugu", "persian", "latvian", "bengali", "serbian", "azerbaijani", "slovenian", "kannada", "estonian", "macedonian", "breton", "basque", "icelandic", "armenian", "nepali", "mongolian", "bosnian", "kazakh", "albanian", "swahili", "galician", "marathi", "punjabi", "sinhala", "khmer", "shona", "yoruba", "somali", "afrikaans", "occitan", "georgian", "belarusian", "tajik", "sindhi", "gujarati", "amharic", "yiddish", "lao", "uzbek", "faroese", "haitian creole", "pashto", "turkmen", "nynorsk", "maltese", "sanskrit", "luxembourgish", "myanmar", "tibetan", "tagalog", "malagasy", "assamese", "tatar", "hawaiian", "lingala", "hausa", "bashkir", "javanese", "sundanese"])
|
||||
whisper_model_dropd = gr.Dropdown(label='Whisper Model', value=params['whisper_model'], choices=["tiny.en", "base.en", "small.en", "medium.en", "tiny", "base", "small", "medium", "large", "turbo"])
|
||||
whisper_language = gr.Dropdown(label='Whisper Language', value=params['whisper_language'], choices=["english", "chinese", "german", "spanish", "russian", "korean", "french", "japanese", "portuguese", "turkish", "polish", "catalan", "dutch", "arabic", "swedish", "italian", "indonesian", "hindi", "finnish", "vietnamese", "hebrew", "ukrainian", "greek", "malay", "czech", "romanian", "danish", "hungarian", "tamil", "norwegian", "thai", "urdu", "croatian", "bulgarian", "lithuanian", "latin", "maori", "malayalam", "welsh", "slovak", "telugu", "persian", "latvian", "bengali", "serbian", "azerbaijani", "slovenian", "kannada", "estonian", "macedonian", "breton", "basque", "icelandic", "armenian", "nepali", "mongolian", "bosnian", "kazakh", "albanian", "swahili", "galician", "marathi", "punjabi", "sinhala", "khmer", "shona", "yoruba", "somali", "afrikaans", "occitan", "georgian", "belarusian", "tajik", "sindhi", "gujarati", "amharic", "yiddish", "lao", "uzbek", "faroese", "haitian creole", "pashto", "turkmen", "nynorsk", "maltese", "sanskrit", "luxembourgish", "myanmar", "tibetan", "tagalog", "malagasy", "assamese", "tatar", "hawaiian", "lingala", "hausa", "bashkir", "javanese", "sundanese"])
|
||||
|
||||
audio.change(
|
||||
auto_transcribe, [audio, auto_submit, whisper_language], [shared.gradio['textbox']]).then(
|
||||
|
|
@ -105,7 +105,7 @@ def ui():
|
|||
|
||||
device_dropd.input(reload_whispermodel, [whisper_model_dropd, whisper_language, device_dropd], [whisper_model_dropd, whisper_language, device_dropd, audio])
|
||||
whisper_model_dropd.change(reload_whispermodel, [whisper_model_dropd, whisper_language, device_dropd], [whisper_model_dropd, whisper_language, device_dropd, audio])
|
||||
whisper_language.change(lambda x: params.update({"whipser_language": x}), whisper_language, None)
|
||||
whisper_language.change(lambda x: params.update({"whisper_language": x}), whisper_language, None)
|
||||
auto_submit.change(lambda x: params.update({"auto_submit": x}), auto_submit, None)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ group.add_argument('--tensor-split', type=str, default=None, help='Split the mod
|
|||
group.add_argument('--row-split', action='store_true', help='Split the model by rows across GPUs. This may improve multi-gpu performance.')
|
||||
group.add_argument('--no-mmap', action='store_true', help='Prevent mmap from being used.')
|
||||
group.add_argument('--mlock', action='store_true', help='Force the system to keep the model in RAM.')
|
||||
group.add_argument('--no-kv-offload', action='store_true', help='Do not offload the K, Q, V to the GPU. This saves VRAM but reduces the performance.')
|
||||
group.add_argument('--no-kv-offload', action='store_true', help='Do not offload the K, Q, V to the GPU. This saves VRAM but reduces performance.')
|
||||
group.add_argument('--batch-size', type=int, default=1024, help='Maximum number of prompt tokens to batch together when calling llama-server. This is the application level batch size.')
|
||||
group.add_argument('--ubatch-size', type=int, default=1024, help='Maximum number of prompt tokens to batch together when calling llama-server. This is the max physical batch size for computation (device level).')
|
||||
group.add_argument('--threads', type=int, default=0, help='Number of threads to use.')
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ def create_ui():
|
|||
shared.gradio['cpu'] = gr.Checkbox(label="cpu", value=shared.args.cpu, info='Use PyTorch in CPU mode.')
|
||||
shared.gradio['disk'] = gr.Checkbox(label="disk", value=shared.args.disk)
|
||||
shared.gradio['row_split'] = gr.Checkbox(label="row_split", value=shared.args.row_split, info='Split the model by rows across GPUs. This may improve multi-gpu performance.')
|
||||
shared.gradio['no_kv_offload'] = gr.Checkbox(label="no_kv_offload", value=shared.args.no_kv_offload, info='Do not offload the K, Q, V to the GPU. This saves VRAM but reduces the performance.')
|
||||
shared.gradio['no_kv_offload'] = gr.Checkbox(label="no_kv_offload", value=shared.args.no_kv_offload, info='Do not offload the K, Q, V to the GPU. This saves VRAM but reduces performance.')
|
||||
shared.gradio['no_mmap'] = gr.Checkbox(label="no-mmap", value=shared.args.no_mmap)
|
||||
shared.gradio['mlock'] = gr.Checkbox(label="mlock", value=shared.args.mlock)
|
||||
shared.gradio['numa'] = gr.Checkbox(label="numa", value=shared.args.numa, info='NUMA support can help on some systems with non-uniform memory access.')
|
||||
|
|
@ -134,7 +134,7 @@ def create_ui():
|
|||
ui.create_refresh_button(shared.gradio['customized_template'], lambda: None, lambda: {'choices': utils.get_available_instruction_templates()}, 'refresh-button', interactive=not mu)
|
||||
|
||||
shared.gradio['customized_template_submit'] = gr.Button("Submit", variant="primary", interactive=not mu)
|
||||
gr.Markdown("This allows you to set a customized template for the model currently selected in the \"Model loader\" menu. Whenever the model gets loaded, this template will be used in place of the template specified in the model's medatada, which sometimes is wrong.")
|
||||
gr.Markdown("This allows you to set a customized template for the model currently selected in the \"Model loader\" menu. Whenever the model gets loaded, this template will be used in place of the template specified in the model's metadata, which sometimes is wrong.")
|
||||
|
||||
with gr.Row():
|
||||
shared.gradio['model_status'] = gr.Markdown('No model is loaded' if shared.model_name == 'None' else 'Ready')
|
||||
|
|
@ -231,7 +231,7 @@ def load_model_wrapper(selected_model, loader, autoload=False):
|
|||
def load_lora_wrapper(selected_loras):
|
||||
yield ("Applying the following LoRAs to {}:\n\n{}".format(shared.model_name, '\n'.join(selected_loras)))
|
||||
add_lora_to_model(selected_loras)
|
||||
yield ("Successfuly applied the LoRAs")
|
||||
yield ("Successfully applied the LoRAs")
|
||||
|
||||
|
||||
def download_model_wrapper(repo_id, specific_file, progress=gr.Progress(), return_links=False, check=False):
|
||||
|
|
|
|||
Loading…
Reference in a new issue