Spaces:
Runtime error
Runtime error
Update llama_cpp_inf.py
Browse files- llama_cpp_inf.py +0 -11
llama_cpp_inf.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
## Imports
|
2 |
-
from llama_cpp import Llama
|
3 |
import re
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
from gradio_client import Client
|
@@ -23,13 +22,3 @@ def run_inference_lcpp(jsonstr, user_search):
|
|
23 |
frag_res = re.findall(r'\w+|\s+|[^\w\s]', input_string)
|
24 |
for word in frag_res:
|
25 |
yield word
|
26 |
-
|
27 |
-
if __name__ == "__main__":
|
28 |
-
prompt = """Context: A vector database, vector store or vector search engine is a database that can store vectors (fixed-length lists of numbers) along with other data items. Vector databases typically implement one or more Approximate Nearest Neighbor (ANN) algorithms,[1][2] so that one can search the database with a query vector to retrieve the closest matching database records.
|
29 |
-
|
30 |
-
Vectors are mathematical representations of data in a high-dimensional space. In this space, each dimension corresponds to a feature of the data, with the number of dimensions ranging from a few hundred to tens of thousands, depending on the complexity of the data being represented. A vector's position in this space represents its characteristics. Words, phrases, or entire documents, as well as images, audio, and other types of data, can all be vectorized; Prompt: Describe what is a vector database"""
|
31 |
-
res = llm(prompt, **generation_kwargs) # Res is a dictionary
|
32 |
-
|
33 |
-
## Unpack and the generated text from the LLM response dictionary and print it
|
34 |
-
print(res["choices"][0]["text"])
|
35 |
-
# res is short for result
|
|
|
1 |
## Imports
|
|
|
2 |
import re
|
3 |
from huggingface_hub import hf_hub_download
|
4 |
from gradio_client import Client
|
|
|
22 |
frag_res = re.findall(r'\w+|\s+|[^\w\s]', input_string)
|
23 |
for word in frag_res:
|
24 |
yield word
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|