removes print statements, tries to debug the embeddings
Browse files
App/Chat/utils/Summarize.py
CHANGED
@@ -4,10 +4,10 @@ import google.generativeai as palm
|
|
4 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
5 |
from langchain import PromptTemplate
|
6 |
import os
|
7 |
-
from poe_api_wrapper import PoeApi
|
8 |
import pprint
|
9 |
|
10 |
-
client = PoeApi("sXvCnfYy8CHnXNTRlxhmVg==")
|
11 |
bot = "Assistant"
|
12 |
CHAT_CODE = ""
|
13 |
|
@@ -98,7 +98,6 @@ async def PalmTextModel(text, candidates=1):
|
|
98 |
|
99 |
|
100 |
async def Summarizer(essay):
|
101 |
-
print(essay)
|
102 |
docs = text_splitter.create_documents([essay])
|
103 |
|
104 |
# for 1 large document
|
@@ -115,6 +114,8 @@ async def Summarizer(essay):
|
|
115 |
# Gather and execute the tasks concurrently
|
116 |
responses = await asyncio.gather(*tasks)
|
117 |
main = " ".join(responses)
|
118 |
-
print(main)
|
119 |
ans = await PalmTextModel(combine_prompt.format(text=main))
|
120 |
return ans
|
|
|
|
|
|
|
|
4 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
5 |
from langchain import PromptTemplate
|
6 |
import os
|
7 |
+
# from poe_api_wrapper import PoeApi
|
8 |
import pprint
|
9 |
|
10 |
+
# client = PoeApi("sXvCnfYy8CHnXNTRlxhmVg==")
|
11 |
bot = "Assistant"
|
12 |
CHAT_CODE = ""
|
13 |
|
|
|
98 |
|
99 |
|
100 |
async def Summarizer(essay):
|
|
|
101 |
docs = text_splitter.create_documents([essay])
|
102 |
|
103 |
# for 1 large document
|
|
|
114 |
# Gather and execute the tasks concurrently
|
115 |
responses = await asyncio.gather(*tasks)
|
116 |
main = " ".join(responses)
|
|
|
117 |
ans = await PalmTextModel(combine_prompt.format(text=main))
|
118 |
return ans
|
119 |
+
|
120 |
+
|
121 |
+
|
App/Embedding/utils/Initialize.py
CHANGED
@@ -62,6 +62,7 @@ def search(query: str, task_id: str):
|
|
62 |
|
63 |
|
64 |
def encode(temp: list[Document]):
|
|
|
65 |
PINECONE_API_KEY = os.environ.get("PINECONE_API_KEY")
|
66 |
# find your environment next to the api key in pinecone console
|
67 |
PINECONE_ENV = os.environ.get("PINECONE_ENVIRONMENT")
|
|
|
62 |
|
63 |
|
64 |
def encode(temp: list[Document]):
|
65 |
+
print(temp)
|
66 |
PINECONE_API_KEY = os.environ.get("PINECONE_API_KEY")
|
67 |
# find your environment next to the api key in pinecone console
|
68 |
PINECONE_ENV = os.environ.get("PINECONE_ENVIRONMENT")
|