Spaces:
Sleeping
Sleeping
Asaad Almutareb
commited on
Commit
·
d41780e
1
Parent(s):
c30ce87
code cleaning
Browse files
app.py
CHANGED
@@ -3,7 +3,10 @@ from hf_mixtral_agent import agent_executor
|
|
3 |
from innovation_pathfinder_ai.source_container.container import (
|
4 |
all_sources
|
5 |
)
|
6 |
-
from innovation_pathfinder_ai.utils import
|
|
|
|
|
|
|
7 |
|
8 |
if __name__ == "__main__":
|
9 |
|
@@ -13,7 +16,7 @@ if __name__ == "__main__":
|
|
13 |
|
14 |
def bot(history):
|
15 |
response = infer(history[-1][0], history)
|
16 |
-
sources =
|
17 |
src_list = '\n'.join(sources)
|
18 |
response_w_sources = response['output']+"\n\n\n Sources: \n\n\n"+src_list
|
19 |
history[-1][1] = response_w_sources
|
|
|
3 |
from innovation_pathfinder_ai.source_container.container import (
|
4 |
all_sources
|
5 |
)
|
6 |
+
from innovation_pathfinder_ai.utils.utils import extract_urls
|
7 |
+
from innovation_pathfinder_ai.utils import logger
|
8 |
+
|
9 |
+
logger = logger.get_console_logger("app")
|
10 |
|
11 |
if __name__ == "__main__":
|
12 |
|
|
|
16 |
|
17 |
def bot(history):
|
18 |
response = infer(history[-1][0], history)
|
19 |
+
sources = extract_urls(all_sources)
|
20 |
src_list = '\n'.join(sources)
|
21 |
response_w_sources = response['output']+"\n\n\n Sources: \n\n\n"+src_list
|
22 |
history[-1][1] = response_w_sources
|
innovation_pathfinder_ai/database/db_handler.py
CHANGED
@@ -2,7 +2,7 @@ from sqlmodel import SQLModel, create_engine, Session, select
|
|
2 |
from innovation_pathfinder_ai.database.schema import Sources
|
3 |
from innovation_pathfinder_ai.utils.logger import get_console_logger
|
4 |
|
5 |
-
sqlite_file_name = "database.
|
6 |
sqlite_url = f"sqlite:///{sqlite_file_name}"
|
7 |
engine = create_engine(sqlite_url, echo=False)
|
8 |
|
|
|
2 |
from innovation_pathfinder_ai.database.schema import Sources
|
3 |
from innovation_pathfinder_ai.utils.logger import get_console_logger
|
4 |
|
5 |
+
sqlite_file_name = "innovation_pathfinder_ai/database/database.sqlite3"
|
6 |
sqlite_url = f"sqlite:///{sqlite_file_name}"
|
7 |
engine = create_engine(sqlite_url, echo=False)
|
8 |
|