Spaces:
Running
on
Zero
Fix
I'll merge this myself, but let me know if there're any issues.
(Actually, I just realized that the error is raised because the token used in this Space was invalidated for some reason. I replaced it with a new token and now the Space is working.)
Just for info, there are a bunch of environment files that would not be necessary for people duplicating the space, and the requirements file is perhaps more comprehensive than necessary :)
Thanks for the feedback.
Regarding the setting files for formatters and pre-commit
, they are useful to keep the repo clean, and as this repo is duplicated and modified from my repo, the code is following the rules in the settings files I added in this PR, so basically they are harmless. Also, I think people who just want to duplicate this Space don't care such setting files, and as they are just settings for developers, they don't affect their use. That being said, as this repo is not my own, maybe I shouldn't have added them. Sorry if it bothered you. I personally prefer to have such settings in repositories, which can be different from my preferred settings, but if you prefer not to have them, feel free to remove them.
As for the requirements.txt
(and uv.lock
), IMO, library versions for Spaces should be pinned as much as possible because one of the most common reasons old Spaces break is that dependency libraries are updated when they are not pinned. Actually, the reason I misunderstood that the error of this Space was due to dependency updated was that I recently saw a very similar error in another Space where the cause was indeed dependency updates.
FYI, "minimal" dependencies are written in pyproject.toml
here and the requirements.txt
is generated by uv
so that this Space can use exactly the same library versions as my local environment where I tested. (Technically, in the case of Spaces, some library versions are pinned in the base Dockerfile
, SDK version is specified in README.md
, and it always installs the latest spaces
after installing requirements.txt
, so there are some unavoidable differences, though). So, if you want to update dependencies of this repo, you can update pyproject.toml
and run the uv
command in the requirements.txt
.
In the case of Spaces, the base Dockerfile
might be changed in the future, and the model repository this Space is using might be changed as well, so this Space might get broken at some point, but at least, pinning dependency versions in requirements.txt
would significantly reduce the chance that this Space gets broken due to dependency updates. Also, it would make it easier to fix this Space when it breaks because you can reproduce the original environment where this Space was working in your local env from uv.lock
or requirements.txt
.