panml icon indicating copy to clipboard operation
panml copied to clipboard

Keep model in memory

Open vsraptor opened this issue 2 years ago • 5 comments

Is there a way to load the model in memory i.e. when you run a script you just connect to the model instead of loading it every time.

This way you can speed up the startup time !

vsraptor avatar May 28 '23 18:05 vsraptor

Good question, let's look into it!

wanoz avatar May 28 '23 22:05 wanoz

Hey, just want to follow up on this question. Not sure if this is what you're after: we can load in the fine tuned model using: ModelPack(model='./results/', source='local')

wanoz avatar May 29 '23 22:05 wanoz

no I meant...something like:

ModelPack(model='gpt2', source='in-mem-connect')

vsraptor avatar May 30 '23 14:05 vsraptor

I see... happy to chat further to discuss how to make this work

wanoz avatar May 30 '23 14:05 wanoz

I think it will be hard... An idea is to have a Server that runs the model and expose let say REST API (.predict(), .embedings() ...) ... or socket...

I found easier way .... just load the model in interactive ipython session and use autoreload for the code i'm testing... this way model is in memory until i quit the session.. and I can change the code w/o reloading the model.

vsraptor avatar May 31 '23 15:05 vsraptor