Fix #16
This commit is contained in:
parent
7d1977e8f0
commit
ae004eb69e
1 changed files with 12 additions and 1 deletions
|
@ -262,6 +262,17 @@ class Llama:
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def embed(self, input: str) -> List[float]:
|
||||||
|
"""Embed a string.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
input: The utf-8 encoded string to embed.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A list of embeddings
|
||||||
|
"""
|
||||||
|
return list(map(float, self.create_embedding(input)["data"][0]["embedding"]))
|
||||||
|
|
||||||
def _create_completion(
|
def _create_completion(
|
||||||
self,
|
self,
|
||||||
prompt: str,
|
prompt: str,
|
||||||
|
|
Loading…
Reference in a new issue