Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import time
|
|
7 |
from uuid import uuid4
|
8 |
from datetime import datetime, timedelta
|
9 |
from pathlib import Path
|
10 |
-
from huggingface_hub import CommitScheduler
|
11 |
from auditqa.sample_questions import QUESTIONS
|
12 |
from auditqa.reports import files, report_list, new_files, new_report_list
|
13 |
from auditqa.process_chunks import load_chunks, getconfig, get_local_qdrant
|
@@ -48,7 +48,10 @@ scheduler = CommitScheduler(
|
|
48 |
# hence, comment out line below when creating for first time
|
49 |
#vectorstores = load_chunks()
|
50 |
# once the vectore embeddings are created we will use qdrant client to access these
|
51 |
-
|
|
|
|
|
|
|
52 |
|
53 |
#####---------------------CHAT-----------------------------------------------------
|
54 |
def start_chat(query,history):
|
|
|
7 |
from uuid import uuid4
|
8 |
from datetime import datetime, timedelta
|
9 |
from pathlib import Path
|
10 |
+
from huggingface_hub import CommitScheduler, HfApi
|
11 |
from auditqa.sample_questions import QUESTIONS
|
12 |
from auditqa.reports import files, report_list, new_files, new_report_list
|
13 |
from auditqa.process_chunks import load_chunks, getconfig, get_local_qdrant
|
|
|
48 |
# hence, comment out line below when creating for first time
|
49 |
#vectorstores = load_chunks()
|
50 |
# once the vectore embeddings are created we will use qdrant client to access these
|
51 |
+
try:
|
52 |
+
vectorstores = get_local_qdrant()
|
53 |
+
except Exception as e:
|
54 |
+
HfApi.restart_space("GIZ/audit_assistant")
|
55 |
|
56 |
#####---------------------CHAT-----------------------------------------------------
|
57 |
def start_chat(query,history):
|