Update app.py
Browse files
app.py
CHANGED
|
@@ -43,16 +43,18 @@ class VectorStore:
|
|
| 43 |
|
| 44 |
def populate_vectors(self, dataset):
|
| 45 |
# Sélectionner les colonnes pertinentes à concaténer
|
| 46 |
-
names = dataset['train']['name'][:
|
| 47 |
-
ingredients = dataset['train']['ingredients'][:
|
| 48 |
-
instructions = dataset['train']['instructions'][:
|
| 49 |
-
cuisine = dataset['train']['cuisine'][:
|
| 50 |
-
total_time = dataset['train']['total_time'][:
|
| 51 |
|
| 52 |
# Concaténer les textes à partir des colonnes sélectionnées
|
| 53 |
texts = [
|
| 54 |
-
f"Name: {name}. Ingredients: {ingr}. Instructions: {instr}. Cuisine: {cui}. Total time: {total} minutes."
|
| 55 |
-
for name, ingr, instr, cui, total in zip(names, ingredients, instructions, cuisine, total_time)
|
|
|
|
|
|
|
| 56 |
]
|
| 57 |
|
| 58 |
# Ajouter les embeddings au store de vecteurs
|
|
|
|
| 43 |
|
| 44 |
def populate_vectors(self, dataset):
|
| 45 |
# Sélectionner les colonnes pertinentes à concaténer
|
| 46 |
+
names = dataset['train']['name'][:200]
|
| 47 |
+
ingredients = dataset['train']['ingredients'][:200]
|
| 48 |
+
instructions = dataset['train']['instructions'][:200]
|
| 49 |
+
cuisine = dataset['train']['cuisine'][:200]
|
| 50 |
+
total_time = dataset['train']['total_time'][:200]
|
| 51 |
|
| 52 |
# Concaténer les textes à partir des colonnes sélectionnées
|
| 53 |
texts = [
|
| 54 |
+
#f"Name: {name}. Ingredients: {ingr}. Instructions: {instr}. Cuisine: {cui}. Total time: {total} minutes."
|
| 55 |
+
#for name, ingr, instr, cui, total in zip(names, ingredients, instructions, cuisine, total_time)
|
| 56 |
+
f"Name: {name}. Ingredients: {ingr}. Instructions: {instr}."
|
| 57 |
+
for name, ingr, instr, cui, total in zip(names, ingredients, instructions)
|
| 58 |
]
|
| 59 |
|
| 60 |
# Ajouter les embeddings au store de vecteurs
|