Spaces:
Runtime error
Runtime error
Jorge Henao
commited on
Commit
·
92361bf
1
Parent(s):
62a36e2
pinecone refactor
Browse files- about.py +1 -1
- app.py +2 -2
- pinecode_quieries.py → pinecone_quieries.py +1 -8
about.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from
|
2 |
import streamlit as st
|
3 |
|
4 |
def show_about_ask2democracy():
|
|
|
1 |
+
from pinecone_quieries import PineconeProposalQueries
|
2 |
import streamlit as st
|
3 |
|
4 |
def show_about_ask2democracy():
|
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
import time
|
2 |
from about import show_about_ask2democracy
|
3 |
import streamlit as st
|
4 |
-
from
|
5 |
from config import Config
|
6 |
from samples import *
|
7 |
|
8 |
-
queries =
|
9 |
api_key = Config.es_password,
|
10 |
environment = Config.pinecone_environment,
|
11 |
embedding_dim = Config.embedding_dim,
|
|
|
1 |
import time
|
2 |
from about import show_about_ask2democracy
|
3 |
import streamlit as st
|
4 |
+
from pinecone_quieries import PineconeProposalQueries
|
5 |
from config import Config
|
6 |
from samples import *
|
7 |
|
8 |
+
queries = PineconeProposalQueries (index_name= Config.index_name,
|
9 |
api_key = Config.es_password,
|
10 |
environment = Config.pinecone_environment,
|
11 |
embedding_dim = Config.embedding_dim,
|
pinecode_quieries.py → pinecone_quieries.py
RENAMED
@@ -5,13 +5,6 @@ from haystack.document_stores import ElasticsearchDocumentStore
|
|
5 |
from haystack.pipelines import ExtractiveQAPipeline, DocumentSearchPipeline
|
6 |
from haystack.document_stores import PineconeDocumentStore
|
7 |
from haystack.nodes import EmbeddingRetriever, OpenAIAnswerGenerator
|
8 |
-
|
9 |
-
import json
|
10 |
-
import logging
|
11 |
-
import os
|
12 |
-
import shutil
|
13 |
-
import sys
|
14 |
-
import uuid
|
15 |
from json import JSONDecodeError
|
16 |
from pathlib import Path
|
17 |
from typing import List, Optional
|
@@ -73,7 +66,7 @@ class DocumentQueries(ABC):
|
|
73 |
def search_by_query(self, query : str, retriever_top_k: int, reader_top_k: int, index_name: str = None, filters = None):
|
74 |
pass
|
75 |
|
76 |
-
class
|
77 |
|
78 |
def __init__(self, index_name: str, api_key, reader_name_or_path: str, use_gpu = True,
|
79 |
embedding_dim = 384, environment = "us-east1-gcp", OPENAI_key = None) -> None:
|
|
|
5 |
from haystack.pipelines import ExtractiveQAPipeline, DocumentSearchPipeline
|
6 |
from haystack.document_stores import PineconeDocumentStore
|
7 |
from haystack.nodes import EmbeddingRetriever, OpenAIAnswerGenerator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
from json import JSONDecodeError
|
9 |
from pathlib import Path
|
10 |
from typing import List, Optional
|
|
|
66 |
def search_by_query(self, query : str, retriever_top_k: int, reader_top_k: int, index_name: str = None, filters = None):
|
67 |
pass
|
68 |
|
69 |
+
class PineconeProposalQueries(DocumentQueries):
|
70 |
|
71 |
def __init__(self, index_name: str, api_key, reader_name_or_path: str, use_gpu = True,
|
72 |
embedding_dim = 384, environment = "us-east1-gcp", OPENAI_key = None) -> None:
|