Better isolation + various improvements

#133
by ngxson HF staff - opened

Better isolation

Before, output files (imatrix, gguf, README) are all stored under root folder.

Now with tempfile.TemporaryDirectory(dir="outputs"), all output and intermediate files will be stored temporary under outputs/* directory. They will be deleted after the conversion is finished.

This has 2 benefits:

  • Files are being clean up automatically after each run --> for example, if last user converted a big 70B model, then it will be clean up and the next user have full space to work with
  • Runs are isolated on to the other --> we can now run multiple conversions in parallel

Better security

All calls to subprocess.run are now done with shell=False. This prevent potential command injections.

Better log output

Error will now be logged in a more readable format:

image.png

ngxson changed pull request status to open
ggml.ai org

There's a merge conflict here, is that intended - I think it's cause by the other downloads PR you merged.

Yes it's intended, I'll resolve the conflict later. Maybe merging this after https://huggingface.co/spaces/ggml-org/gguf-my-repo/discussions/128 so @ariG23498 won't need to update his PR?

Cannot merge
This branch has merge conflicts in the following files:
  • app.py

Sign up or log in to comment