Spaces:
Sleeping
Sleeping
erase-code
Browse files
app.py
CHANGED
@@ -124,19 +124,15 @@ def get_similar_places(user_embedding):
|
|
124 |
return ranked_results
|
125 |
|
126 |
# Get top 10 destinations
|
127 |
-
def get_top_10_destinations(user_query
|
128 |
normalized_query = normalize_query(user_query)
|
129 |
user_embedding = get_user_embedding(normalized_query)
|
130 |
similar_places = get_similar_places(user_embedding)
|
131 |
|
132 |
-
|
133 |
-
|
134 |
-
]
|
135 |
|
136 |
-
|
137 |
-
return "Tidak ada tempat yang ditemukan dengan kesesuaian yang cukup."
|
138 |
-
|
139 |
-
return filtered[:10]
|
140 |
|
141 |
# Generate response using llama3.1
|
142 |
def generate_response(user_query, top_places, temperature):
|
|
|
124 |
return ranked_results
|
125 |
|
126 |
# Get top 10 destinations
|
127 |
+
def get_top_10_destinations(user_query):
|
128 |
normalized_query = normalize_query(user_query)
|
129 |
user_embedding = get_user_embedding(normalized_query)
|
130 |
similar_places = get_similar_places(user_embedding)
|
131 |
|
132 |
+
if not similar_places:
|
133 |
+
return "Tidak ada tempat yang ditemukan."
|
|
|
134 |
|
135 |
+
return similar_places[:10]
|
|
|
|
|
|
|
136 |
|
137 |
# Generate response using llama3.1
|
138 |
def generate_response(user_query, top_places, temperature):
|