You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
n_gpu_layers=3# Number of model layers to offload to GPU
11
+
)
12
+
13
+
## Generation kwargs
14
+
generation_kwargs= {
15
+
"max_tokens":1024,
16
+
"stop":["<|end|>"],
17
+
"echo":False, # Echo the prompt in the output
18
+
"top_k":1# This is essentially greedy decoding, since the model will always return the highest-probability token. Set this value > 1 for sampling decoding
19
+
}
20
+
21
+
defrun_inference_lcpp(jsonstr, user_search):
22
+
prompt=f"""Instructions for the assistant: Starting from the URLs and the keywords deriving from Google search results and provided to you in JSON format, generate a meaningful summary of the search results that satisfies the user's query.
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.
36
+
37
+
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"""
38
+
res=llm(prompt, **generation_kwargs) # Res is a dictionary
39
+
40
+
## Unpack and the generated text from the LLM response dictionary and print it
0 commit comments