pyllama icon indicating copy to clipboard operation
pyllama copied to clipboard

pyllama/downloads returns empty folders

Open flyjgh opened this issue 1 year ago • 34 comments

Hello, when running:

python3 -m llama.download

the command runs almost instantly but only creates empty folders named 7B, 13B, etc... I also tried by specifying --model-size and --folder with the same result

flyjgh avatar Mar 22 '23 18:03 flyjgh

Just updated the code base. Can you reinstall pyllama and try?

juncongmoo avatar Mar 23 '23 07:03 juncongmoo

I just reinstalled and I still got the same behavior

flyjgh avatar Mar 23 '23 18:03 flyjgh

Same problem in Mac M1

lucascr91 avatar Mar 23 '23 20:03 lucascr91

Same in Fedora

ivanstepanovftw avatar Mar 23 '23 21:03 ivanstepanovftw

same problem for me here (intel mac)

lesurJ avatar Mar 23 '23 22:03 lesurJ

Do you have wget installed? You need to install wget otherwise you will only get empty folder.

shadowwalker2718 avatar Mar 24 '23 00:03 shadowwalker2718

I have wget installed and in my path. It doesn't work

lucascr91 avatar Mar 24 '23 00:03 lucascr91

I can not reproduce the error. It always work for me.

image

juncongmoo avatar Mar 24 '23 02:03 juncongmoo

Try pip install hiq-python -U ?

juncongmoo avatar Mar 24 '23 03:03 juncongmoo

i tried after installing wget and hiq-python but it still does not work

I do not get any warnings..

❯ python3 -m llama.download --model_size 7B ❤️ Resume download is supported. You can ctrl-c and rerun the program to resume the downloading Downloading tokenizer... ✅ pyllama_data/tokenizer.model ✅ pyllama_data/tokenizer_checklist.chk Downloading 7B ✅ pyllama_data/7B/params.json ✅ pyllama_data/7B/checklist.chk Checking checksums

lesurJ avatar Mar 24 '23 06:03 lesurJ

same on ubuntu, I can only get the token but not the model

sharlec avatar Mar 24 '23 14:03 sharlec

same on ubuntu, I can only get the token but not the model

I am using ubuntu and it works well for me though.

mldevorg avatar Mar 24 '23 18:03 mldevorg

work well on ubuntu, i pull last code from repo and reinstall pylama (pip install pyllama -U)

alexch33 avatar Mar 26 '23 14:03 alexch33

work for mac(intel), empty folder for mac(m1)

txdywy avatar Mar 31 '23 03:03 txdywy

wget is on my path, and hiq-python is up to date. m1 mac, python 3.10, pyllama v0.0.18:

$ python -m llama.download --model_size 7B --folder llama
❤️ Resume download is supported. You can ctrl-c and rerun the program to resume the downloading
Downloading tokenizer...
✅ llama/tokenizer.model
✅ llama/tokenizer_checklist.chk
Downloading 7B
✅ llama/7B/params.json
✅ llama/7B/checklist.chk
Checking checksums

$ ls llama/
7B/

$ du -sh llama/
  0B	llama/

llimllib avatar Apr 04 '23 14:04 llimllib

Clearing pyllama out from my site-packages folder, cloning this repo, and running the same command as the previous comment in the root directory of this repository works as it is supposed to.

llimllib avatar Apr 04 '23 14:04 llimllib

Can confirm what @llimllib said. I had to do:

pip uninstall pyllama
git clone https://github.com/juncongmoo/pyllama
pip install -e pyllama

After that it works for me.

I also had another issue with py_itree, as reported here. I think this is happening on Mac M1 machines.

This was fixed by uninstalling py_itree first, then installing it from source:

pip uninstall py_itree
pip install https://github.com/juncongmoo/itree/archive/refs/tags/v0.0.18.tar.gz

michael-erasmus avatar Apr 05 '23 20:04 michael-erasmus

If you are on macos there is a problem with the download_community.sh script that is called from download.py:

  • it uses declare -A which needs bash v4+, but macos only comes with bash 3.x
  • default shell on recent macos is zsh so we can install a newer bash without breaking things, just brew install bash
  • but the download_community.sh script has #!/bin/bash at the top which points to the system bash instead of homebrew bash (which has been installed as the default, if I bash --version I get version 5.2.15 now, but in a different location)
    • we can fix this by changing the line at the top of download_community.sh to #!/usr/bin/env bash (should work for everyone with that change I think?)
  • now we just need to brew install wget

After these steps I am now in the process of downloading the 7B checkpoints 🎉

I'm on an M1, Ventura 13.3

anentropic avatar Apr 06 '23 15:04 anentropic

Hopefully this is fixed following #70 and #71, let me know if you see any problems with the updated script!

llimllib avatar Apr 07 '23 15:04 llimllib

@llimllib I'm getting the same issue on windows

george-adams1 avatar Apr 08 '23 16:04 george-adams1

macOS running ARM/Apple Silicon M1 empty folder always persists no matter what steps are listed here or in the linked commits.

AstroWa3l avatar Apr 13 '23 03:04 AstroWa3l

Still encounter this problem after upgrading bash to v5.

Genie-Liu avatar Apr 13 '23 07:04 Genie-Liu

@Genie-Liu @AstroWa3l if you clone this repository and run llama/download_community.sh 7B /tmp/llama-models hopefully you'll get the 7B model in /tmp/models. Looks like there hasn't been a new release yet, so this issue will persist at least until then

llimllib avatar Apr 13 '23 19:04 llimllib

@llimllib Unfortunately it did not fix the issue

AstroWa3l avatar Apr 13 '23 22:04 AstroWa3l

@AstroWa3l can you elaborate? Were there errors? What was the output?

llimllib avatar Apr 14 '23 12:04 llimllib

the script might benefit from having set -e at the top so it exits early instead of continuing after errors

anentropic avatar Apr 14 '23 12:04 anentropic

@anentropic I do that with all my scripts, but I've never worked on this project before and wasn't sure how they were calling the script so I didn't add it

llimllib avatar Apr 14 '23 13:04 llimllib

@llimllib I found one error after following your instructions and it was due to a missing md5sum package so I installed it and now it is downloading. I could not download it due to a lack of this package on my system to check hashes. Thank you!!!

AstroWa3l avatar Apr 14 '23 20:04 AstroWa3l

@llimllib

✅ Worked on Mac (2012) OS Catalina x64_86 architecture Intel chip

  1. Clone Repo
pip uninstall pyllama
git clone https://github.com/juncongmoo/pyllama
pip install -e pyllama
  1. cd pyllama
  2. Run llama/download_community.sh 7B /tmp/llama-models ,

🔴 However using python3 -m llama.download --model_size 7B --folder llama/ command it fails with recursion error.

% pipenv run python3 -m llama.download --model_size 7B --folder llama/
Traceback (most recent call last):
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/my_user/pyllama/llama/download.py", line 87, in <module>
    download(args)
  File "/Users/my_user/pyllama/llama/download.py", line 20, in download
    download(args)
  File "/Users/my_user/pyllama/llama/download.py", line 20, in download
    download(args)
  File "/Users/my_user/pyllama/llama/download.py", line 20, in download
    download(args)
  [Previous line repeated 985 more times]
  File "/Users/my_user/pyllama/llama/download.py", line 17, in download
    retcode = hiq.execute_cmd(cmd, verbose=False, shell=True, runtime_output=True, env=os.environ)
  File "/Users/my_user/.local/share/virtualenvs/my-env-cIchWPfI/lib/python3.9/site-packages/hiq/utils.py", line 101, in execute_cmd
    proc = subprocess.Popen(
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1737, in _execute_child
    for k, v in env.items():
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/_collections_abc.py", line 851, in __iter__
    for key in self._mapping:
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/os.py", line 701, in __iter__
    yield self.decodekey(key)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/os.py", line 759, in decode
    return value.decode(encoding, 'surrogateescape')
RecursionError: maximum recursion depth exceeded while calling a Python object`

@Genie-Liu @AstroWa3l if you clone this repository and run llama/download_community.sh 7B /tmp/llama-models hopefully you'll get the 7B model in /tmp/models. Looks like there hasn't been a new release yet, so this issue will persist at least until then

Divjyot avatar Apr 15 '23 14:04 Divjyot

Ah! I already had this via brew install coreutils

anentropic avatar Apr 16 '23 18:04 anentropic