Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -28,9 +28,10 @@ def set_custom_prompt():
|
|
28 |
|
29 |
def load_llm():
|
30 |
llm = CTransformers(
|
31 |
-
model = 'TheBloke/Llama-2-7B-Chat-GGML',
|
32 |
#model = AutoModel.from_pretrained("TheBloke/Llama-2-7B-Chat-GGML"),
|
33 |
-
|
|
|
34 |
max_new_token = 512,
|
35 |
temperature = 0.5
|
36 |
)
|
@@ -48,8 +49,10 @@ def retrieval_qa_chain(llm,prompt,db):
|
|
48 |
return qa_chain
|
49 |
|
50 |
def qa_bot():
|
51 |
-
embeddings = HuggingFaceBgeEmbeddings(model_name = 'sentence-transformers/all-MiniLM-L6-v2',
|
52 |
-
|
|
|
|
|
53 |
|
54 |
|
55 |
db = FAISS.load_local(DB_FAISS_PATH, embeddings,allow_dangerous_deserialization=True)
|
|
|
28 |
|
29 |
def load_llm():
|
30 |
llm = CTransformers(
|
31 |
+
#model = 'TheBloke/Llama-2-7B-Chat-GGML',
|
32 |
#model = AutoModel.from_pretrained("TheBloke/Llama-2-7B-Chat-GGML"),
|
33 |
+
model = 'MaziyarPanahi/BioMistral-7B-GGUF'
|
34 |
+
model_type = 'mistral',
|
35 |
max_new_token = 512,
|
36 |
temperature = 0.5
|
37 |
)
|
|
|
49 |
return qa_chain
|
50 |
|
51 |
def qa_bot():
|
52 |
+
#embeddings = HuggingFaceBgeEmbeddings(model_name = 'sentence-transformers/all-MiniLM-L6-v2',
|
53 |
+
# model_kwargs = {'device':'cpu'})
|
54 |
+
embeddings = HuggingFaceBgeEmbeddings(model_name = 'NeuML/pubmedbert-base-embeddings',
|
55 |
+
model_kwargs = {'device':'cpu'} )
|
56 |
|
57 |
|
58 |
db = FAISS.load_local(DB_FAISS_PATH, embeddings,allow_dangerous_deserialization=True)
|