Add runtime check to ensure embedding is enabled if trying to generate embeddings
This commit is contained in:
parent
5c50af7462
commit
cefc69ea43
1 changed files with 5 additions and 0 deletions
|
@ -242,6 +242,11 @@ class Llama:
|
|||
"""
|
||||
assert self.ctx is not None
|
||||
|
||||
if self.params.embedding == False:
|
||||
raise RuntimeError(
|
||||
"Llama model must be created with embedding=True to call this method"
|
||||
)
|
||||
|
||||
if self.verbose:
|
||||
llama_cpp.llama_reset_timings(self.ctx)
|
||||
|
||||
|
|
Loading…
Reference in a new issue