Added a new helper function to normalize user-provided model paths, ensuring consistent handling of path separators and rejecting invalid paths. Updated the `remove_model` and `download_model` functions to utilize this normalization, improving security by validating paths against allowed directories and preventing directory traversal attacks. This enhances the robustness of file handling in the API.
Removed the directory validation logic from the download_model function in api_server.py, simplifying the file download process. Updated version to 1.1.3 in pyproject.toml to reflect changes.
Implemented a new API endpoint to allow downloading model files from the server. The endpoint includes validation for folder and model inputs, checks for file existence, and ensures that the requested file is within allowed directories. Updated the README to document the new endpoint and bumped the version to 1.1.2 in pyproject.toml.
Changed the key from "name" to "filename" in the response structure of the get_model_folder function to better reflect the content being returned. This improves clarity in the API response.
Enhanced the MetricsRegistry class to include PyTorch version information if the library is available. This addition allows for better tracking of the PyTorch environment in the monitoring metrics.
Updated the `download_url_with_agent` function to accept an optional `token` parameter for authorization headers. This allows for more secure downloads when required. Adjusted the model installation process to utilize the token from the JSON data if available.
Explanation: Updated the version in two places to 1.0.8. Clearly, this monumental change required all my focus and skill. It's the software equivalent of changing a light bulb.
Apparently, success_resp didn’t need a message—it was doing just fine without it. Cleaned it up so it stops oversharing like that one friend at brunch. You're welcome, future me.
What I did: Documented Prometheus metrics for the server in the README. Because everyone likes pretty tables and knowing exactly how they're breaking their hardware.
Snark level: I didn't break the server (this time). You're welcome!
Explanation:
Finally bumped the version numbers in `pyproject.toml` to 1.0.7. Clearly, 1.0.6 was living its best life, but we had to let it go like Rose did Jack in Titanic. Onwards and upwards!
Revised the `gpu_info` module by wrapping imports in a try-except block to log potential import errors. Removed unused `__init__.py` from the core directory.
Because everyone loves a good install tool, I slapped together a route to magically fetch models from an *allowed* URL list. Turns out the internet is still scary, so I threw in domain checks to keep things wholesome. It's not perfect, but hey, neither am I.
Assembled a shiny new `install.py` for model downloads because apparently, URLs don’t click themselves. Snuck in a logging import in `gpu_info.py`—because who doesn’t love responsible debugging?
Swapped out `diskcache` for `pynvml` because apparently, managing GPU stuff is more exciting than caching. The dependency list also went on a diet – one less thing to pretend I understand.
Love API? Me too. Added a robust API for model and image handling, sprinkled in Prometheus metrics for fun graphs, and tossed in colorful logging because why not? Pretty sure I even taught it to make coffee (spoiler: it doesn’t). All aboard the functionality express! 🚂