Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Upload folder using huggingface_hub
Browse files- config.py +2 -1
- db.py +1 -1
- modules/db/reembed.py +1 -1
- modules/nodes/init.py +3 -3
config.py
CHANGED
|
@@ -73,7 +73,8 @@ class SanatanConfig:
|
|
| 73 |
"name": "bhagavat_gita",
|
| 74 |
"title": "Bhagavat Gita",
|
| 75 |
"output_dir": "./output/bhagavat_gita",
|
| 76 |
-
"collection_name": "
|
|
|
|
| 77 |
"unit" : "page",
|
| 78 |
"metadata_fields": [
|
| 79 |
{"name": "file", "datatype": "str"},
|
|
|
|
| 73 |
"name": "bhagavat_gita",
|
| 74 |
"title": "Bhagavat Gita",
|
| 75 |
"output_dir": "./output/bhagavat_gita",
|
| 76 |
+
"collection_name": "bhagavat_gita_openai",
|
| 77 |
+
"collection_embedding_fn": "openai",
|
| 78 |
"unit" : "page",
|
| 79 |
"metadata_fields": [
|
| 80 |
{"name": "file", "datatype": "str"},
|
db.py
CHANGED
|
@@ -55,7 +55,7 @@ class SanatanDatabase:
|
|
| 55 |
|
| 56 |
validated_response = validate_relevance_queryresult(query, response)
|
| 57 |
|
| 58 |
-
return
|
| 59 |
|
| 60 |
def search_for_literal(
|
| 61 |
self, collection_name: str, literal_to_search_for: str, n_results=2
|
|
|
|
| 55 |
|
| 56 |
validated_response = validate_relevance_queryresult(query, response)
|
| 57 |
|
| 58 |
+
return response
|
| 59 |
|
| 60 |
def search_for_literal(
|
| 61 |
self, collection_name: str, literal_to_search_for: str, n_results=2
|
modules/db/reembed.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
from db import SanatanDatabase
|
| 2 |
|
| 3 |
if __name__ == "__main__":
|
| 4 |
-
SanatanDatabase().reembed_collection_openai(collection_name="
|
|
|
|
| 1 |
from db import SanatanDatabase
|
| 2 |
|
| 3 |
if __name__ == "__main__":
|
| 4 |
+
SanatanDatabase().reembed_collection_openai(collection_name="bhagavat_gita")
|
modules/nodes/init.py
CHANGED
|
@@ -57,9 +57,9 @@ You have access to three scripture search tools. You MUST follow these rules whe
|
|
| 57 |
|
| 58 |
Example user queries and tool usage:
|
| 59 |
|
| 60 |
-
- “Show me verse 34 of Vishnu
|
| 61 |
-
- “Show me references to Garuda in Vishnu Purananm.” →
|
| 62 |
-
- “Search for the exact phrase ‘Om Namo Narayanaya’” →
|
| 63 |
"""
|
| 64 |
),
|
| 65 |
SystemMessage(
|
|
|
|
| 57 |
|
| 58 |
Example user queries and tool usage:
|
| 59 |
|
| 60 |
+
- “Show me verse 34 of Vishnu Sahasranamam” → `tool_search_db_by_metadata`
|
| 61 |
+
- “Show me references to Garuda in Vishnu Purananm.” → `tool_semantic_vector_search`
|
| 62 |
+
- “Search for the exact phrase ‘Om Namo Narayanaya’” → `tool_search_db_by_literal_text`
|
| 63 |
"""
|
| 64 |
),
|
| 65 |
SystemMessage(
|