Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Upload folder using huggingface_hub
Browse files
server.py
CHANGED
|
@@ -6,6 +6,7 @@ from fastapi.responses import JSONResponse
|
|
| 6 |
from pydantic import BaseModel
|
| 7 |
from app import chat
|
| 8 |
from config import SanatanConfig
|
|
|
|
| 9 |
|
| 10 |
router = APIRouter()
|
| 11 |
|
|
@@ -21,7 +22,8 @@ class Message(BaseModel):
|
|
| 21 |
async def handle_greet(msg: Message):
|
| 22 |
markdown = "Namaskaram 🙏 I am **bhashyam.ai** and I can help you explore the following scriptures:\n---\n"
|
| 23 |
for scripture in SanatanConfig().scriptures:
|
| 24 |
-
|
|
|
|
| 25 |
|
| 26 |
session_id = msg.session_id
|
| 27 |
if not session_id:
|
|
|
|
| 6 |
from pydantic import BaseModel
|
| 7 |
from app import chat
|
| 8 |
from config import SanatanConfig
|
| 9 |
+
from db import SanatanDatabase
|
| 10 |
|
| 11 |
router = APIRouter()
|
| 12 |
|
|
|
|
| 22 |
async def handle_greet(msg: Message):
|
| 23 |
markdown = "Namaskaram 🙏 I am **bhashyam.ai** and I can help you explore the following scriptures:\n---\n"
|
| 24 |
for scripture in SanatanConfig().scriptures:
|
| 25 |
+
num_records = SanatanDatabase().count(collection_name=scripture["collection_name"])
|
| 26 |
+
markdown += f"- {scripture['title']} : `{num_records}` verses\n"
|
| 27 |
|
| 28 |
session_id = msg.session_id
|
| 29 |
if not session_id:
|