Update app.py
Browse files
app.py
CHANGED
@@ -42,8 +42,8 @@ def generate_input(input_type, image=None, text=None, response_amount=3):
|
|
42 |
return vector_search(combined_input,response_amount) #search through embedded document w/ input
|
43 |
|
44 |
# load embeddings and metadata
|
45 |
-
embeddings = np.load("
|
46 |
-
metadata = pd.read_csv("
|
47 |
|
48 |
# vector search function
|
49 |
def vector_search(query,top_n=3):
|
@@ -56,9 +56,9 @@ def vector_search(query,top_n=3):
|
|
56 |
result_text=""
|
57 |
for index,row in results.iterrows(): #loop through results to get Title, Description, and Genre for top n outputs
|
58 |
if index!=top_n-1:
|
59 |
-
result_text+=f"
|
60 |
else:
|
61 |
-
|
62 |
return result_text
|
63 |
|
64 |
|
|
|
42 |
return vector_search(combined_input,response_amount) #search through embedded document w/ input
|
43 |
|
44 |
# load embeddings and metadata
|
45 |
+
embeddings = np.load("dog_data_embeddings.npy") #created using sentence_transformers on kaggle
|
46 |
+
metadata = pd.read_csv("dog_metadata.csv") #created using sentence_transformers on kaggle
|
47 |
|
48 |
# vector search function
|
49 |
def vector_search(query,top_n=3):
|
|
|
56 |
result_text=""
|
57 |
for index,row in results.iterrows(): #loop through results to get Title, Description, and Genre for top n outputs
|
58 |
if index!=top_n-1:
|
59 |
+
result_text+=f"Breed: {row['breed']} Description: {row['description']} Temperament: {row['temperament']} Energy Level: {row['energy_level_category']} Trainability: {row['trainability_category']} Demeanor: {row['demeanor_category']} \n\n"
|
60 |
else:
|
61 |
+
result_text+=f"Breed: {row['breed']} Description: {row['description']} Temperament: {row['temperament']} Energy Level: {row['energy_level_category']} Trainability: {row['trainability_category']} Demeanor: {row['demeanor_category']}"
|
62 |
return result_text
|
63 |
|
64 |
|