Skip to content

How to stop model from loading every time? #377

Answered by BetaDoggo
nivibilla asked this question in Q&A
Discussion options

You must be logged in to vote

That sounds like an issue with your code. Make sure that your are not accidentally looping the Llama(model_path="model-path") line.
Here's a basic example I made where the model is only loaded once at the start then inference is run 5 times:

llm = Llama(model_path="model-path")
i=0
while (i < 5):
	output = llm("The sky is", max_tokens=20, echo=True)
	print(output)
	i = i + 1

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@nivibilla
Comment options

@nivibilla
Comment options

Answer selected by nivibilla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants