Files
mealie/mealie/scripts/install_model.py
Hayden 83a076bd8b feat: improve idle memory usage (#1758)
* health check as python script

* install crfpp model via python

* drop curl from finale container

* use uvicorn by default w/ gunicorn as opt in

* recommend setting mem limit for container
2022-10-22 20:00:13 -08:00

22 lines
502 B
Python

import requests
from mealie.services.parser_services import crfpp
MODEL_URL = "https://github.com/mealie-recipes/nlp-model/releases/download/v1.0.0/model.crfmodel"
def main():
"""
Install the model into the crfpp directory
"""
r = requests.get(MODEL_URL, stream=True, allow_redirects=True)
with open(crfpp.MODEL_PATH, "wb") as f:
for chunk in r.iter_content(chunk_size=1024):
if chunk:
f.write(chunk)
if __name__ == "__main__":
main()