Update variable name
This commit is contained in:
parent
a3352923c7
commit
a7c9e38287
1 changed files with 6 additions and 6 deletions
|
@ -532,7 +532,7 @@ class Llama:
|
||||||
An embedding object.
|
An embedding object.
|
||||||
"""
|
"""
|
||||||
assert self.ctx is not None
|
assert self.ctx is not None
|
||||||
_model: str = model if model is not None else self.model_path
|
model_name: str = model if model is not None else self.model_path
|
||||||
|
|
||||||
if self.params.embedding == False:
|
if self.params.embedding == False:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
|
@ -562,7 +562,7 @@ class Llama:
|
||||||
"index": 0,
|
"index": 0,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"model": _model,
|
"model": model_name,
|
||||||
"usage": {
|
"usage": {
|
||||||
"prompt_tokens": n_tokens,
|
"prompt_tokens": n_tokens,
|
||||||
"total_tokens": n_tokens,
|
"total_tokens": n_tokens,
|
||||||
|
@ -612,7 +612,7 @@ class Llama:
|
||||||
text: bytes = b""
|
text: bytes = b""
|
||||||
returned_characters: int = 0
|
returned_characters: int = 0
|
||||||
stop = stop if stop is not None else []
|
stop = stop if stop is not None else []
|
||||||
_model: str = model if model is not None else self.model_path
|
model_name: str = model if model is not None else self.model_path
|
||||||
|
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
llama_cpp.llama_reset_timings(self.ctx)
|
llama_cpp.llama_reset_timings(self.ctx)
|
||||||
|
@ -711,7 +711,7 @@ class Llama:
|
||||||
"id": completion_id,
|
"id": completion_id,
|
||||||
"object": "text_completion",
|
"object": "text_completion",
|
||||||
"created": created,
|
"created": created,
|
||||||
"model": _model,
|
"model": model_name,
|
||||||
"choices": [
|
"choices": [
|
||||||
{
|
{
|
||||||
"text": text[start:].decode("utf-8", errors="ignore"),
|
"text": text[start:].decode("utf-8", errors="ignore"),
|
||||||
|
@ -740,7 +740,7 @@ class Llama:
|
||||||
"id": completion_id,
|
"id": completion_id,
|
||||||
"object": "text_completion",
|
"object": "text_completion",
|
||||||
"created": created,
|
"created": created,
|
||||||
"model": _model,
|
"model": model_name,
|
||||||
"choices": [
|
"choices": [
|
||||||
{
|
{
|
||||||
"text": text[returned_characters:].decode(
|
"text": text[returned_characters:].decode(
|
||||||
|
@ -810,7 +810,7 @@ class Llama:
|
||||||
"id": completion_id,
|
"id": completion_id,
|
||||||
"object": "text_completion",
|
"object": "text_completion",
|
||||||
"created": created,
|
"created": created,
|
||||||
"model": _model,
|
"model": model_name,
|
||||||
"choices": [
|
"choices": [
|
||||||
{
|
{
|
||||||
"text": text_str,
|
"text": text_str,
|
||||||
|
|
Loading…
Reference in a new issue