Spaces:
Sleeping
Sleeping
Léo Bourrel
commited on
Commit
·
550e87b
1
Parent(s):
341806e
clean: imports
Browse files- app.py +2 -0
- custom_pgvector.py +1 -5
app.py
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import streamlit.components.v1 as components
|
3 |
from css import load_css
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
import streamlit as st
|
4 |
import streamlit.components.v1 as components
|
5 |
from css import load_css
|
custom_pgvector.py
CHANGED
@@ -6,7 +6,6 @@ import enum
|
|
6 |
import logging
|
7 |
from functools import partial
|
8 |
from typing import (
|
9 |
-
TYPE_CHECKING,
|
10 |
Any,
|
11 |
Callable,
|
12 |
Dict,
|
@@ -30,9 +29,6 @@ from pgvector.sqlalchemy import Vector
|
|
30 |
from sqlalchemy import delete
|
31 |
from sqlalchemy.orm import Session, declarative_base, relationship
|
32 |
|
33 |
-
if TYPE_CHECKING:
|
34 |
-
from langchain.vectorstores._pgvector_data_models import CollectionStore
|
35 |
-
|
36 |
|
37 |
class DistanceStrategy(str, enum.Enum):
|
38 |
"""Enumerator of the Distance strategies."""
|
@@ -356,7 +352,7 @@ class CustomPGVector(VectorStore):
|
|
356 |
metadata={
|
357 |
"id": result.Article.id,
|
358 |
"title": result.Article.title,
|
359 |
-
"doi": result.Article.doi
|
360 |
},
|
361 |
),
|
362 |
result.distance if self.embedding_function is not None else None,
|
|
|
6 |
import logging
|
7 |
from functools import partial
|
8 |
from typing import (
|
|
|
9 |
Any,
|
10 |
Callable,
|
11 |
Dict,
|
|
|
29 |
from sqlalchemy import delete
|
30 |
from sqlalchemy.orm import Session, declarative_base, relationship
|
31 |
|
|
|
|
|
|
|
32 |
|
33 |
class DistanceStrategy(str, enum.Enum):
|
34 |
"""Enumerator of the Distance strategies."""
|
|
|
352 |
metadata={
|
353 |
"id": result.Article.id,
|
354 |
"title": result.Article.title,
|
355 |
+
"doi": result.Article.doi,
|
356 |
},
|
357 |
),
|
358 |
result.distance if self.embedding_function is not None else None,
|