Skip to content

Commit

Permalink
Issue#2
Browse files Browse the repository at this point in the history
  • Loading branch information
Lin-jun-xiang committed Aug 31, 2023
1 parent 2a4d6f7 commit 8fd68f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def get_response(query: str) -> str:
return (
'Something wrong in docGPT...\n'
'1. If you are using gpt4free model, '
'try to select the different provider.\n'
'try to select the different provider. '
'(Or wait a moment, maybe there have something wrong in gpt4free)\n'
'2. If you are using openai model, '
'check your usage for openai api key.'
)
Expand All @@ -151,6 +152,7 @@ def get_response(query: str) -> str:
with doc_container:
docs = upload_and_process_pdf()
model = create_doc_gpt(docs)
del docs
st.write('---')

if 'response' not in st.session_state:
Expand Down
7 changes: 6 additions & 1 deletion docGPT/docGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ def _embeddings(self):
# If have openai api
embeddings = OpenAIEmbeddings()
except:
embeddings = HuggingFaceEmbeddings()
embeddings = HuggingFaceEmbeddings(
model_name=(
'sentence-transformers/'
'multi-qa-MiniLM-L6-cos-v1'
)
)

db = FAISS.from_documents(
documents=self.docs,
Expand Down

0 comments on commit 8fd68f8

Please sign in to comment.