Skip to content
This repository was archived by the owner on Oct 22, 2023. It is now read-only.

Add option for local model, instead of downloading it every time.#14

Closed
alfredo-f wants to merge 2 commits intodaveshap:mainfrom
alfredo-f:feature/local_testing
Closed

Add option for local model, instead of downloading it every time.#14
alfredo-f wants to merge 2 commits intodaveshap:mainfrom
alfredo-f:feature/local_testing

Conversation

@alfredo-f
Copy link
Contributor

Hi David,

Pre-requisites of this pull request

This pull request is meant to be merged after #13.

What

This pull request add the possibility of loading the embedding model from a local folder, instead of having to download it every time you need to spin up the microservice.

How

  • Add a new variable ARE_YOU_TESTING__LOAD_MODEL_LOCAL in utils.py
  • Loads the model from a local folder with tensorflow.saved_model
  • Add instructions in README.md

@alfredo-f alfredo-f changed the title Feature/local testing Add option for local model, instead of downloading it every time. Apr 25, 2023
@daveshap
Copy link
Owner

I don't think this is necessary as TFHUB caches the model by default. This seems like superfluous code. It would be better to check in code at instantiation rather than set a static variable.

@alfredo-f
Copy link
Contributor Author

I think this approach is a little bit more flexible:

  • you can point to the folder where the model is downloaded once and for all, instead of having to rely on the caching mechanisms of TFHUB
  • you can plug and play multiple models downloaded once, switching quickly between them to compare the performance

@alfredo-f alfredo-f force-pushed the feature/local_testing branch from 75c093f to 482534a Compare April 25, 2023 10:48
@alfredo-f alfredo-f closed this Apr 25, 2023
@alfredo-f alfredo-f deleted the feature/local_testing branch April 25, 2023 11:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants