oobabooga / text-generation-webui

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

'WindowsPath' object has no attribute 'endswith' in windows10 #336

Closed innightwolfsleep closed 1 year ago

innightwolfsleep commented 1 year ago

Describe the bug

Got a bug when work with https://github.com/oobabooga/text-generation-webui:

Loading llama-7b-hf...
Loading model ...
Traceback (most recent call last):
  File "C:\Users\innig\oobabooga\text-generation-webui\server.py", line 194, in <module>
    shared.model, shared.tokenizer = load_model(shared.model_name)
  File "C:\Users\innig\oobabooga\text-generation-webui\modules\models.py", line 119, in load_model
    model = load_quant(path_to_model, Path(f"models/{pt_model}"), 4)
  File "C:\Users\innig\oobabooga\text-generation-webui\repositories\GPTQ-for-LLaMa\llama.py", line 241, in load_quant
    if checkpoint.endswith('.safetensors'):
AttributeError: 'WindowsPath' object has no attribute 'endswith'

Fixed it on my PC with replacing in llama.py if checkpoint.endswith('.safetensors'): to if str(checkpoint).endswith('.safetensors'):

Is there an existing issue for this?

Reproduction

Just use in on win10

Screenshot

No response

Logs

Loading llama-7b-hf...
Loading model ...
Traceback (most recent call last):
  File "C:\Users\innig\oobabooga\text-generation-webui\server.py", line 194, in <module>
    shared.model, shared.tokenizer = load_model(shared.model_name)
  File "C:\Users\innig\oobabooga\text-generation-webui\modules\models.py", line 119, in load_model
    model = load_quant(path_to_model, Path(f"models/{pt_model}"), 4)
  File "C:\Users\innig\oobabooga\text-generation-webui\repositories\GPTQ-for-LLaMa\llama.py", line 241, in load_quant
    if checkpoint.endswith('.safetensors'):
AttributeError: 'WindowsPath' object has no attribute 'endswith'

System Info

windows10, RTX3060
oobabooga commented 1 year ago

Your local copy of the repository is not up to date. This has already been fixed.

git pull

github-actions[bot] commented 1 year ago

This issue has been closed due to inactivity for 30 days. If you believe it is still relevant, please leave a comment below.

praveen3330 commented 6 months ago

Getting same issue. AttributeError: 'WindowsPath' object has no attribute 'endswith'

How to solve this?