oobabooga / text-generation-webui

A Gradio web UI for Large Language Models.
GNU Affero General Public License v3.0
40.59k stars 5.31k forks source link

server.py: error: unrecognized arguments: --cai-chat #2139

Closed Hidrargiros closed 1 year ago

Hidrargiros commented 1 year ago

Describe the bug

Hello, I'm new to the community and I don't have any programming experience, but I came across TextGen AI WebUI, which I found to be amazing. My problem arises from the fact that I have an AMD system with Windows 10, which is not compatible with it. So, I tried to see if installing it online would work. The thing is, everything goes well until I try to open it, and it tells me that it doesn't recognize the arguments "--cai-chat". Please let me know if there is a solution to this problem despite my AMD system (or if it will work on Windows someday). Please provide me with detailed steps to follow if there is a solution. Thank you.

Is there an existing issue for this?

Reproduction

/content/drive/MyDrive/text-generation-webui python server.py --share --model mayaeary/pygmalion-6b_dev-4bit-128g --settings settings-colab.json --no-stream --wbits 4 --extensions send_pictures google_translate gallery --groupsize 128 --cai-chat INFO:NumExpr defaulting to 2 threads. usage: server.py [-h] [--notebook] [--chat] [--character CHARACTER] [--model MODEL] [--lora LORA [LORA ...]] [--model-dir MODEL_DIR] [--lora-dir LORA_DIR] [--model-menu] [--no-stream] [--settings SETTINGS] [--extensions EXTENSIONS [EXTENSIONS ...]] [--verbose] [--cpu] [--auto-devices] [--gpu-memory GPU_MEMORY [GPU_MEMORY ...]] [--cpu-memory CPU_MEMORY] [--disk] [--disk-cache-dir DISK_CACHE_DIR] [--load-in-8bit] [--bf16] [--no-cache] [--xformers] [--sdp-attention] [--trust-remote-code] [--threads THREADS] [--n_batch N_BATCH] [--no-mmap] [--mlock] [--cache-capacity CACHE_CAPACITY] [--n-gpu-layers N_GPU_LAYERS] [--wbits WBITS] [--model_type MODEL_TYPE] [--groupsize GROUPSIZE] [--pre_layer PRE_LAYER [PRE_LAYER ...]] [--checkpoint CHECKPOINT] [--monkey-patch] [--quant_attn] [--warmup_autotune] [--fused_mlp] [--autogptq] [--triton] [--flexgen] [--percent PERCENT [PERCENT ...]] [--compress-weight] [--pin-weight [PIN_WEIGHT]] [--deepspeed] [--nvme-offload-dir NVME_OFFLOAD_DIR] [--local_rank LOCAL_RANK] [--rwkv-strategy RWKV_STRATEGY] [--rwkv-cuda-on] [--listen] [--listen-host LISTEN_HOST] [--listen-port LISTEN_PORT] [--share] [--auto-launch] [--gradio-auth-path GRADIO_AUTH_PATH] [--api] [--api-blocking-port API_BLOCKING_PORT] [--api-streaming-port API_STREAMING_PORT] [--public-api] [--multimodal-pipeline MULTIMODAL_PIPELINE] server.py: error: unrecognized arguments: --cai-chat

Screenshot

@title 3. Launch

import json

@markdown if you dont know what to enter the previous cell should have printed available inputs
paste it here

model_load = "mayaeary/pygmalion-6b_dev-4bit-128g" #@param {type:"string"}

Parameters

auto_devices = False #@param {type:"boolean"}

load_4bit_models = True #@param {type:"boolean"}

groupsize_128 = True #@param {type:"boolean"} load_in_8bit = False #@param {type:"boolean"} chat = True #@param {type:"boolean"}

text_streaming = True #@param {type:"boolean"} activate_silero_text_to_speech = False #@param {type:"boolean"} activate_sending_pictures = True #@param {type:"boolean"} activate_character_bias = False #@param {type:"boolean"} chat_language = "Spanish" # @param ['Afrikaans', 'Albanian', 'Amharic', 'Arabic', 'Armenian', 'Azerbaijani', 'Basque', 'Belarusian', 'Bengali', 'Bosnian', 'Bulgarian', 'Catalan', 'Cebuano', 'Chinese (Simplified)', 'Chinese (Traditional)', 'Corsican', 'Croatian', 'Czech', 'Danish', 'Dutch', 'English', 'Esperanto', 'Estonian', 'Finnish', 'French', 'Frisian', 'Galician', 'Georgian', 'German', 'Greek', 'Gujarati', 'Haitian Creole', 'Hausa', 'Hawaiian', 'Hebrew', 'Hindi', 'Hmong', 'Hungarian', 'Icelandic', 'Igbo', 'Indonesian', 'Irish', 'Italian', 'Japanese', 'Javanese', 'Kannada', 'Kazakh', 'Khmer', 'Korean', 'Kurdish', 'Kyrgyz', 'Lao', 'Latin', 'Latvian', 'Lithuanian', 'Luxembourgish', 'Macedonian', 'Malagasy', 'Malay', 'Malayalam', 'Maltese', 'Maori', 'Marathi', 'Mongolian', 'Myanmar (Burmese)', 'Nepali', 'Norwegian', 'Nyanja (Chichewa)', 'Pashto', 'Persian', 'Polish', 'Portuguese (Portugal, Brazil)', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Scots Gaelic', 'Serbian', 'Sesotho', 'Shona', 'Sindhi', 'Sinhala (Sinhalese)', 'Slovak', 'Slovenian', 'Somali', 'Spanish', 'Sundanese', 'Swahili', 'Swedish', 'Tagalog (Filipino)', 'Tajik', 'Tamil', 'Telugu', 'Thai', 'Turkish', 'Ukrainian', 'Urdu', 'Uzbek', 'Vietnamese', 'Welsh', 'Xhosa', 'Yiddish', 'Yoruba', 'Zulu']

activate_google_translate = (chat_language != "English")

language_codes = {'Afrikaans': 'af', 'Albanian': 'sq', 'Amharic': 'am', 'Arabic': 'ar', 'Armenian': 'hy', 'Azerbaijani': 'az', 'Basque': 'eu', 'Belarusian': 'be', 'Bengali': 'bn', 'Bosnian': 'bs', 'Bulgarian': 'bg', 'Catalan': 'ca', 'Cebuano': 'ceb', 'Chinese (Simplified)': 'zh-CN', 'Chinese (Traditional)': 'zh-TW', 'Corsican': 'co', 'Croatian': 'hr', 'Czech': 'cs', 'Danish': 'da', 'Dutch': 'nl', 'English': 'en', 'Esperanto': 'eo', 'Estonian': 'et', 'Finnish': 'fi', 'French': 'fr', 'Frisian': 'fy', 'Galician': 'gl', 'Georgian': 'ka', 'German': 'de', 'Greek': 'el', 'Gujarati': 'gu', 'Haitian Creole': 'ht', 'Hausa': 'ha', 'Hawaiian': 'haw', 'Hebrew': 'iw', 'Hindi': 'hi', 'Hmong': 'hmn', 'Hungarian': 'hu', 'Icelandic': 'is', 'Igbo': 'ig', 'Indonesian': 'id', 'Irish': 'ga', 'Italian': 'it', 'Japanese': 'ja', 'Javanese': 'jw', 'Kannada': 'kn', 'Kazakh': 'kk', 'Khmer': 'km', 'Korean': 'ko', 'Kurdish': 'ku', 'Kyrgyz': 'ky', 'Lao': 'lo', 'Latin': 'la', 'Latvian': 'lv', 'Lithuanian': 'lt', 'Luxembourgish': 'lb', 'Macedonian': 'mk', 'Malagasy': 'mg', 'Malay': 'ms', 'Malayalam': 'ml', 'Maltese': 'mt', 'Maori': 'mi', 'Marathi': 'mr', 'Mongolian': 'mn', 'Myanmar (Burmese)': 'my', 'Nepali': 'ne', 'Norwegian': 'no', 'Nyanja (Chichewa)': 'ny', 'Pashto': 'ps', 'Persian': 'fa', 'Polish': 'pl', 'Portuguese (Portugal, Brazil)': 'pt', 'Punjabi': 'pa', 'Romanian': 'ro', 'Russian': 'ru', 'Samoan': 'sm', 'Scots Gaelic': 'gd', 'Serbian': 'sr', 'Sesotho': 'st', 'Shona': 'sn', 'Sindhi': 'sd', 'Sinhala (Sinhalese)': 'si', 'Slovak': 'sk', 'Slovenian': 'sl', 'Somali': 'so', 'Spanish': 'es', 'Sundanese': 'su', 'Swahili': 'sw', 'Swedish': 'sv', 'Tagalog (Filipino)': 'tl', 'Tajik': 'tg', 'Tamil': 'ta', 'Telugu': 'te', 'Thai': 'th', 'Turkish': 'tr', 'Ukrainian': 'uk', 'Urdu': 'ur', 'Uzbek': 'uz', 'Vietnamese': 'vi', 'Welsh': 'cy', 'Xhosa': 'xh', 'Yiddish': 'yi', 'Yoruba': 'yo', 'Zulu': 'zu'}

%cd {repo_dir}

Applying the selected language and setting the prompt size to 2048

if 8bit mode is selected

j = json.loads(open('settings-colab-template.json', 'r').read()) j["google_translate-language string"] = language_codes[chat_language] if load_in_8bit: j["chat_prompt_size"] = 2048 with open('settings-colab.json', 'w') as f: f.write(json.dumps(j, indent=4))

params = set() if chat: params.add('--cai-chat')

if load_in_8bit: params.add('--load-in-8bit')

if auto_devices:

params.add('--auto-devices')

if load_4bit_models: params.add('--wbits 4')

if groupsize_128: params.add('--groupsize 128')

active_extensions = [] if activate_sending_pictures: active_extensions.append('send_pictures') if activate_character_bias: active_extensions.append('character_bias') if activate_google_translate: active_extensions.append('google_translate') if activate_silero_text_to_speech: active_extensions.append('silero_tts') active_extensions.append('gallery')

if len(active_extensions) > 0: params.add(f'--extensions {" ".join(active_extensions)}')

if not text_streaming or activate_google_translate or activate_silero_text_to_speech: params.add('--no-stream') if activate_character_bias: params.add('--verbose')

Starting the web UI

cmd = f"python server.py --share --model {model_load} --settings settings-colab.json {' '.join(params)}" print(cmd) !$cmd

Logs

server.py: error: unrecognized arguments: --cai-chat

System Info

Im using Google colab doc
codeMonkey-shin commented 1 year ago

use --chat, --cai-chat is deprecated

Hidrargiros commented 1 year ago

use --chat, --cai-chat is deprecated

Alright, but how can I do that?

codeMonkey-shin commented 1 year ago

use python server.py --share --model mayaeary/pygmalion-6b_dev-4bit-128g --settings settings-colab.json --no-stream --wbits 4 --extensions send_pictures google_translate gallery --groupsize 128 --chat

instead python server.py --share --model mayaeary/pygmalion-6b_dev-4bit-128g --settings settings-colab.json --no-stream --wbits 4 --extensions send_pictures google_translate gallery --groupsize 128 --cai-chat

Hidrargiros commented 1 year ago

use python server.py --share --model mayaeary/pygmalion-6b_dev-4bit-128g --settings settings-colab.json --no-stream --wbits 4 --extensions send_pictures google_translate gallery --groupsize 128 --chat

instead python server.py --share --model mayaeary/pygmalion-6b_dev-4bit-128g --settings settings-colab.json --no-stream --wbits 4 --extensions send_pictures google_translate gallery --groupsize 128 --cai-chat

I have tried changing it in the code by adding: params = set() if chat: params.add('--chat')

It has warned me by saying: "The Gradio 'share link' feature downloads a proprietary and unaudited blob to create a reverse tunnel. This is potentially dangerous." This has caused another error that says: FileNotFoundError: [Errno 2] No such file or directory: 'characters'. I'm not sure if what you have told me should be done differently or if we need to address this other error... I don't know if what you have told me is done in another way or is that now we have to solve this other error... Help please

Arte437 commented 1 year ago

I have the same problem, I even changed the parameters in the code from (--cai-chat) to (--caht), but mine resulted in the same problem as the friend, saying that: "ERROR:The path to the model does not exist. Exiting." Did you find out how to solve this buddy?