-
Notifications
You must be signed in to change notification settings - Fork 111
/
image.sd
105 lines (85 loc) · 2.08 KB
/
image.sd
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
schema image {
document image {
# Don't need to guess language
field language type string {
indexing: "en" | set_language
}
field url type string {
indexing: summary | index
}
field caption type string {
indexing: summary | index
}
field license type string {
indexing: summary | index
rank:filter
match:word
}
field nsfw type string {
indexing: summary | index
rank:filter
match:word
}
field similarity type byte { #scaled from float
indexing: summary | attribute
attribute: paged
}
field aesthetic type byte { #scaled from float
indexing: summary | attribute
attribute: paged
}
field watermark type byte { #scaled from float
indexing: summary | attribute
}
field punsafe type byte { #scaled from float
indexing: summary | attribute
attribute: paged
}
field height type int {
indexing: summary | attribute
attribute: paged
}
field width type int {
indexing: summary | attribute
attribute: paged
}
field centroids type array<string> {
indexing: summary | index
match:word
stemming:none
rank: filter
}
field reduced_vector type tensor<bfloat16>(x[128]) {
indexing: attribute
attribute: paged
}
field vector type tensor<bfloat16>(x[768]) {
indexing: summary
}
}
document-summary vector-summary {
from-disk
summary vector { }
}
fieldset default {
fields: caption, url
}
rank-profile default {
inputs {
query(q) tensor<float>(x[768])
query(q_reduced) tensor<float>(x[128])
}
num-threads-per-search: 2
first-phase {
expression: sum(query(q_reduced) * attribute(reduced_vector))
}
match-features: firstPhase
}
rank-profile text {
num-threads-per-search: 2
first-phase {
expression: nativeRank(caption) + nativeRank(url)
}
}
}