Spaces:
Sleeping
Sleeping
Commit
·
3882789
1
Parent(s):
eb1f97f
update full prompt
Browse files
app.py
CHANGED
|
@@ -190,7 +190,7 @@ class FiftyOneAssistant:
|
|
| 190 |
"""Wrapper for GPU embedding function."""
|
| 191 |
return get_embedding_gpu(text, config.embedding_model)
|
| 192 |
|
| 193 |
-
def hybrid_search(self, query_text: str, query_vector: List[float], limit: int =
|
| 194 |
"""
|
| 195 |
Hybrid search using only dense vectors + text filtering
|
| 196 |
"""
|
|
@@ -276,14 +276,20 @@ class FiftyOneAssistant:
|
|
| 276 |
|
| 277 |
try:
|
| 278 |
# Prepare the full prompt
|
| 279 |
-
full_prompt = f"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 280 |
|
| 281 |
-
DOCUMENTATION:
|
| 282 |
{context}
|
| 283 |
|
| 284 |
-
|
| 285 |
|
| 286 |
-
|
|
|
|
| 287 |
|
| 288 |
messages = [
|
| 289 |
{"role": "system", "content": config.system_prompt},
|
|
|
|
| 190 |
"""Wrapper for GPU embedding function."""
|
| 191 |
return get_embedding_gpu(text, config.embedding_model)
|
| 192 |
|
| 193 |
+
def hybrid_search(self, query_text: str, query_vector: List[float], limit: int = 2, text_boost: float = 0.3):
|
| 194 |
"""
|
| 195 |
Hybrid search using only dense vectors + text filtering
|
| 196 |
"""
|
|
|
|
| 276 |
|
| 277 |
try:
|
| 278 |
# Prepare the full prompt
|
| 279 |
+
full_prompt = f"""Your task is to generate a helpful response to the user's query about using FiftyOne, and provide the appropriate function calls and class methods so that the user can understand how to use FiftyOne to achieve their goal.
|
| 280 |
+
|
| 281 |
+
This is the user's query: {user_query}
|
| 282 |
+
|
| 283 |
+
The following is some context about FiftyOne which you may find helful to answer this query:
|
| 284 |
+
|
| 285 |
+
#######
|
| 286 |
|
|
|
|
| 287 |
{context}
|
| 288 |
|
| 289 |
+
#######
|
| 290 |
|
| 291 |
+
You already have knowledge of FiftyOne, and also some additional context. Now, answer the following user query: {user_query}
|
| 292 |
+
"""
|
| 293 |
|
| 294 |
messages = [
|
| 295 |
{"role": "system", "content": config.system_prompt},
|