Add more instructions
Browse files
README.md
CHANGED
|
@@ -70,13 +70,52 @@ from datasets import load_dataset
|
|
| 70 |
dataset = load_dataset("weaviate/wiki-sample", "aws-titan-embed-text-v2", split="train", streaming=True)
|
| 71 |
```
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
### Cohere
|
| 74 |
|
| 75 |
-
**
|
| 76 |
|
| 77 |
```python
|
| 78 |
from datasets import load_dataset
|
| 79 |
-
dataset = load_dataset("weaviate/wiki-sample", "cohere-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
```
|
| 81 |
|
| 82 |
### OpenAI
|
|
@@ -88,6 +127,25 @@ from datasets import load_dataset
|
|
| 88 |
dataset = load_dataset("weaviate/wiki-sample", "openai-text-embedding-3-small", split="train", streaming=True)
|
| 89 |
```
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
**text-embedding-3-large** - 3072d vectors - generated with OpenAI
|
| 92 |
|
| 93 |
```python
|
|
@@ -95,6 +153,25 @@ from datasets import load_dataset
|
|
| 95 |
dataset = load_dataset("weaviate/wiki-sample", "openai-text-embedding-3-large", split="train", streaming=True)
|
| 96 |
```
|
| 97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
### Snowflake
|
| 99 |
|
| 100 |
**snowflake-arctic-embed** - 1024d vectors - generated with Ollama
|
|
@@ -103,3 +180,23 @@ dataset = load_dataset("weaviate/wiki-sample", "openai-text-embedding-3-large",
|
|
| 103 |
from datasets import load_dataset
|
| 104 |
dataset = load_dataset("weaviate/wiki-sample", "snowflake-arctic-embed", split="train", streaming=True)
|
| 105 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
dataset = load_dataset("weaviate/wiki-sample", "aws-titan-embed-text-v2", split="train", streaming=True)
|
| 71 |
```
|
| 72 |
|
| 73 |
+
#### Weaviate collection configuration:
|
| 74 |
+
|
| 75 |
+
```python
|
| 76 |
+
from weaviate.classes.config import Configure
|
| 77 |
+
|
| 78 |
+
client.collections.create(
|
| 79 |
+
name="Wiki",
|
| 80 |
+
|
| 81 |
+
vectorizer_config=[
|
| 82 |
+
Configure.NamedVectors.text2vec_aws(
|
| 83 |
+
name="main_vector",
|
| 84 |
+
model="amazon.titan-embed-text-v2:0",
|
| 85 |
+
region="us-east-1", # make sure to use the correct region for you
|
| 86 |
+
|
| 87 |
+
source_properties=['title', 'text'], # which properties should be used to generate a vector
|
| 88 |
+
)
|
| 89 |
+
],
|
| 90 |
+
)
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
### Cohere
|
| 94 |
|
| 95 |
+
**embed-multilingual-v3** - 768d vectors - generated with Ollama
|
| 96 |
|
| 97 |
```python
|
| 98 |
from datasets import load_dataset
|
| 99 |
+
dataset = load_dataset("weaviate/wiki-sample", "cohere-embed-multilingual-v3", split="train", streaming=True)
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
#### Weaviate collection configuration:
|
| 103 |
+
|
| 104 |
+
```python
|
| 105 |
+
from weaviate.classes.config import Configure
|
| 106 |
+
|
| 107 |
+
client.collections.create(
|
| 108 |
+
name="Wiki",
|
| 109 |
+
|
| 110 |
+
vectorizer_config=[
|
| 111 |
+
Configure.NamedVectors.text2vec_cohere(
|
| 112 |
+
name="main_vector",
|
| 113 |
+
model="embed-multilingual-v3.0",
|
| 114 |
+
|
| 115 |
+
source_properties=['title', 'text'], # which properties should be used to generate a vector
|
| 116 |
+
)
|
| 117 |
+
],
|
| 118 |
+
)
|
| 119 |
```
|
| 120 |
|
| 121 |
### OpenAI
|
|
|
|
| 127 |
dataset = load_dataset("weaviate/wiki-sample", "openai-text-embedding-3-small", split="train", streaming=True)
|
| 128 |
```
|
| 129 |
|
| 130 |
+
#### Weaviate collection configuration:
|
| 131 |
+
|
| 132 |
+
```python
|
| 133 |
+
from weaviate.classes.config import Configure
|
| 134 |
+
|
| 135 |
+
client.collections.create(
|
| 136 |
+
name="Wiki",
|
| 137 |
+
|
| 138 |
+
vectorizer_config=[
|
| 139 |
+
Configure.NamedVectors.text2vec_openai(
|
| 140 |
+
name="main_vector",
|
| 141 |
+
model="text-embedding-3-small",
|
| 142 |
+
|
| 143 |
+
source_properties=['title', 'text'], # which properties should be used to generate a vector
|
| 144 |
+
)
|
| 145 |
+
],
|
| 146 |
+
)
|
| 147 |
+
```
|
| 148 |
+
|
| 149 |
**text-embedding-3-large** - 3072d vectors - generated with OpenAI
|
| 150 |
|
| 151 |
```python
|
|
|
|
| 153 |
dataset = load_dataset("weaviate/wiki-sample", "openai-text-embedding-3-large", split="train", streaming=True)
|
| 154 |
```
|
| 155 |
|
| 156 |
+
#### Weaviate collection configuration:
|
| 157 |
+
|
| 158 |
+
```python
|
| 159 |
+
from weaviate.classes.config import Configure
|
| 160 |
+
|
| 161 |
+
client.collections.create(
|
| 162 |
+
name="Wiki",
|
| 163 |
+
|
| 164 |
+
vectorizer_config=[
|
| 165 |
+
Configure.NamedVectors.text2vec_openai(
|
| 166 |
+
name="main_vector",
|
| 167 |
+
model="text-embedding-3-large",
|
| 168 |
+
|
| 169 |
+
source_properties=['title', 'text'], # which properties should be used to generate a vector
|
| 170 |
+
)
|
| 171 |
+
],
|
| 172 |
+
)
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
### Snowflake
|
| 176 |
|
| 177 |
**snowflake-arctic-embed** - 1024d vectors - generated with Ollama
|
|
|
|
| 180 |
from datasets import load_dataset
|
| 181 |
dataset = load_dataset("weaviate/wiki-sample", "snowflake-arctic-embed", split="train", streaming=True)
|
| 182 |
```
|
| 183 |
+
|
| 184 |
+
#### Weaviate collection configuration:
|
| 185 |
+
|
| 186 |
+
```python
|
| 187 |
+
from weaviate.classes.config import Configure
|
| 188 |
+
|
| 189 |
+
client.collections.create(
|
| 190 |
+
name="Wiki",
|
| 191 |
+
|
| 192 |
+
vectorizer_config=[
|
| 193 |
+
Configure.NamedVectors.text2vec_ollama(
|
| 194 |
+
name="main_vector",
|
| 195 |
+
model="snowflake-arctic-embed",
|
| 196 |
+
api_endpoint="http://host.docker.internal:11434", # If using Docker
|
| 197 |
+
|
| 198 |
+
source_properties=["title", "text"],
|
| 199 |
+
),
|
| 200 |
+
],
|
| 201 |
+
)
|
| 202 |
+
```
|