text-generation-webui icon indicating copy to clipboard operation
text-generation-webui copied to clipboard

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

Open innightwolfsleep opened this issue 2 years ago • 1 comments

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?

  • [X] I have searched the existing issues

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

innightwolfsleep avatar Mar 15 '23 14:03 innightwolfsleep

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

git pull

oobabooga avatar Mar 15 '23 15:03 oobabooga

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

github-actions[bot] avatar Apr 14 '23 23:04 github-actions[bot]

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

How to solve this?

praveen3330 avatar Mar 11 '24 06:03 praveen3330