-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathretriever_test.py
38 lines (35 loc) · 953 Bytes
/
retriever_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from llm import SelfQueryRetriever
from langchain.chains.query_constructor.base import AttributeInfo
available_models = [
"all-MiniLM-L6-v2-f16.gguf",
"mpt-7b-chat-merges-q4_0.gguf",
"nous-hermes-llama2-13b.Q4_0.gguf",
"orca-mini-3b-gguf2-q4_0.gguf",
"replit-code-v1_5-3b-q4_0.gguf",
"gpt4all-falcon-q4_0.gguf",
]
metadata_field_info = [
AttributeInfo(
name="id",
description="The identifier of the song",
type="string",
),
AttributeInfo(
name="singers",
description="The singers of the song",
type="string or list of strings",
),
AttributeInfo(
name="authors",
description="The authors of the song",
type="string",
),
AttributeInfo(
name="title",
description="The title of the song",
type="string",
)
]
SelfQueryRetriever(
available_models[2], metadata_field_info, "Who sang the song Baby?"
)