Skip to content

Commit

Permalink
Move model from Google Drive to Dropbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ishefi committed Jan 11, 2024
1 parent d4c5c72 commit 0834c4c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 81 deletions.
12 changes: 7 additions & 5 deletions download_model.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import shutil

import gdown
import dropbox

from common.config import conf
from common import config

if __name__ == "__main__":
url = f"https://drive.google.com/uc?id={conf.model_zip_id}"
client = dropbox.Dropbox(config.dropbox_token)
destination = "model.zip"
gdown.download(url, destination, quiet=False)
shutil.unpack_archive("model.zip")
_, response = client.files_download("/model.zip")
with open(destination, "wb") as f:
f.write(response.content)
shutil.unpack_archive(destination)
112 changes: 38 additions & 74 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ pymongo = {extras = ["srv"], version = "^4.6.1"}
uvicorn = {extras = ["standard"], version = "^0.25.0"}
pydantic = "^2.5.3"
gensim = "^4.3.2"
gdown = "^4.7.1"
google-auth = "^2.25.2"
python-dateutil = "^2.8.2"
python-multipart = "^0.0.6"
sqlmodel = "^0.0.14"
sqlalchemy-libsql = "^0.1.0"
dropbox = "^11.36.2"


[tool.poetry.group.dev.dependencies]
Expand All @@ -49,7 +49,7 @@ strict = true

[[tool.mypy.overrides]]
module = [
"gdown",
"dropbox",
"gensim.*",
"google.oauth2",
"google.auth.transport",
Expand Down

0 comments on commit 0834c4c

Please sign in to comment.