pyllama icon indicating copy to clipboard operation
pyllama copied to clipboard

Error Downloading Models from Community on Winodws

Open mmortazavi opened this issue 1 year ago • 5 comments

I have cloded the repo, installed all requirements including the CMake and itree based on one of the reported issues, still I run into the following traceback error when trying to download the model via:

python -m llama.download or python -m llama.download --folder .\models\

Exception has occurred: FileNotFoundError
[Errno 2] No such file or directory: '/tmp/error.njkfo9xztnqw.log'
  File "C:\Users\majmo\Git\pyllama\llama\download.py", line 17, in download
    retcode = hiq.execute_cmd(cmd, verbose=True, shell=True, runtime_output=True)
  File "C:\Users\majmo\Git\pyllama\llama\download.py", line 87, in <module>
    download(args)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/error.njkfo9xztnqw.log'

I have tried to see what I can change, but it was nor clear what hiq does actually when executing at line 17!

mmortazavi avatar Mar 23 '23 21:03 mmortazavi

You need to install wget.

shadowwalker2718 avatar Mar 24 '23 00:03 shadowwalker2718

Try pip install hiq-python -U.

juncongmoo avatar Mar 24 '23 03:03 juncongmoo

The nature of the problem changes when installing wget and upgrading hiq-python, now I get:

Traceback (most recent call last):
  File "C:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\majmo\Git\pyllama\llama\download.py", line 90, in <module>
    download(args)
  File "C:\Users\majmo\Git\pyllama\llama\download.py", line 18, in download
    retcode = hiq.execute_cmd(cmd, verbose=False, shell=True, runtime_output=True)
  File "C:\Users\majmo\Git\pyllama\venv\lib\site-packages\hiq\utils.py", line 101, in execute_cmd
    proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env if env else {})
  File "C:\Program Files\Python39\lib\subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files\Python39\lib\subprocess.py", line 1420, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 87] The parameter is incorrect

It has to do with subprocesses execution of the cmd in Windows! Where is this issue mentioned? You labelled it as duplicate.

mmortazavi avatar Mar 24 '23 07:03 mmortazavi

I will try it tomorrow and update here.

juncongmoo avatar Mar 24 '23 07:03 juncongmoo

I found a workaround for this issues:

  1. if you are on windows you have to have WSL and bash installed to be able to run the download script.
  2. you have to have wget installed(in the linux version)
  3. HIQ seems to have an issue executing bash shell scripts in cmd
  4. What you can do is, manually create a version of the download script and add you director( in linux format) and add the model you want as a string
  5. now just use wsl and open bash in commandline and run the download script
  6. now you have your desired model installed and can continue with the setup. For the dev:
  7. I will try to write a .bat file for windows its possible to just check for OS and then execute either .sh or .bat depending on os
  8. will send commit

henryclickclack avatar Mar 24 '23 12:03 henryclickclack