Skip to content

Commit 8fd68f8

Browse files
committed
Issue#2
1 parent 2a4d6f7 commit 8fd68f8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

app.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ def get_response(query: str) -> str:
137137
return (
138138
'Something wrong in docGPT...\n'
139139
'1. If you are using gpt4free model, '
140-
'try to select the different provider.\n'
140+
'try to select the different provider. '
141+
'(Or wait a moment, maybe there have something wrong in gpt4free)\n'
141142
'2. If you are using openai model, '
142143
'check your usage for openai api key.'
143144
)
@@ -151,6 +152,7 @@ def get_response(query: str) -> str:
151152
with doc_container:
152153
docs = upload_and_process_pdf()
153154
model = create_doc_gpt(docs)
155+
del docs
154156
st.write('---')
155157

156158
if 'response' not in st.session_state:

docGPT/docGPT.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,12 @@ def _embeddings(self):
148148
# If have openai api
149149
embeddings = OpenAIEmbeddings()
150150
except:
151-
embeddings = HuggingFaceEmbeddings()
151+
embeddings = HuggingFaceEmbeddings(
152+
model_name=(
153+
'sentence-transformers/'
154+
'multi-qa-MiniLM-L6-cos-v1'
155+
)
156+
)
152157

153158
db = FAISS.from_documents(
154159
documents=self.docs,

0 commit comments

Comments
 (0)