You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to load a fine-tuned model on my flask application which takes input from a text field and generates an output. I was wondering what is the best way to make the model load faster since the text generation takes around 10-15 seconds.
I have my function -
I tried loading gpt2.load_gpt2(sess, model_name=fine_tuned_model) globally but I got an error ValueError: Tensor Tensor("Placeholder:0", shape=(1, ?), dtype=int32) is not an element of this graph.
The text was updated successfully, but these errors were encountered:
Unfortunately there isn't a good solution aside from doing a refresh every n generations (see gpt-2-cloud-run for how this is implemented in Starlette, which will be the same as Flask: https://github.com/minimaxir/gpt-2-cloud-run)
It's an underlying issue with the model architecture which will be addressed in another package I will make.
Hi, I'm trying to load a fine-tuned model on my flask application which takes input from a text field and generates an output. I was wondering what is the best way to make the model load faster since the text generation takes around 10-15 seconds.
I have my function -
`
model_name = os.getcwd() + "/checkpoint/run1/"
`
and in extend text, (the text generator function, I have)
`
def extend_text(text,Sess):
I tried loading
gpt2.load_gpt2(sess, model_name=fine_tuned_model)
globally but I got an errorValueError: Tensor Tensor("Placeholder:0", shape=(1, ?), dtype=int32) is not an element of this graph.
The text was updated successfully, but these errors were encountered: