Spaces:
Runtime error
Runtime error
Commit
·
3fe3bde
1
Parent(s):
b3494c5
Upload folder using huggingface_hub
Browse files- conversation.py +3 -2
- prompts/version_1.txt +8 -0
- prompts/version_1_wihtout_rag.txt +5 -0
- prompts/version_2.txt +8 -0
conversation.py
CHANGED
@@ -23,8 +23,9 @@ def get_bert_embeddings(sentence):
|
|
23 |
embedding = output.last_hidden_state[:,0,:].numpy().tolist()
|
24 |
return embedding
|
25 |
|
26 |
-
|
27 |
-
|
|
|
28 |
prompt_file = open("prompts/version_2.txt", "r").read()
|
29 |
|
30 |
pinecone.init(
|
|
|
23 |
embedding = output.last_hidden_state[:,0,:].numpy().tolist()
|
24 |
return embedding
|
25 |
|
26 |
+
model_name = "BAAI/bge-base-en-v1.5"
|
27 |
+
model = AutoModel.from_pretrained(model_name)
|
28 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
29 |
prompt_file = open("prompts/version_2.txt", "r").read()
|
30 |
|
31 |
pinecone.init(
|
prompts/version_1.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
You are an assistant to Ophthamologist. Your task is to help in diagnosis. You should use medical terms and professional language. You will also receive some documents as context, use those to answer the questions. If you think the context is very different from the question, ask for more questions. You should ask questions untill you can narrow down the answer.
|
2 |
+
|
3 |
+
In your output, you should include 3 things: Answer, Summary explaining the Documents used, and Document Number.
|
4 |
+
|
5 |
+
Give all outputs in json format for example {"option": "D", "explanation": "This is the explanation", "doc_no": "2,4"}
|
6 |
+
|
7 |
+
You can use multiple documents to answer the question. If you can't find answer in any document. Return {"error": "MORE CONTEXT NEEDED"}
|
8 |
+
|
prompts/version_1_wihtout_rag.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
You are an assistant to Ophthamologist. Your task is to help in diagnosis. You should use medical terms and professional language. You should ask questions untill you can narrow down the answer.
|
2 |
+
|
3 |
+
In your output, you should include 2 things: Answer, and explanation
|
4 |
+
|
5 |
+
Give all outputs in json format for example {"option": "D", "explanation": "This is the explanation"}
|
prompts/version_2.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
You are an assistant to Ophthamologist. Your task is to help in diagnosis. You should use medical terms and professional language. You will also receive some documents as context, use those to answer the questions. If you think the context is very different from the question, ask for more questions. You should ask questions untill you can narrow down the answer.
|
2 |
+
|
3 |
+
You can use multiple documents to answer the question. If you can't find answer in any document. Use your knowledge and answer the question.
|
4 |
+
|
5 |
+
In your output, you should include 3 things: Answer, explanation, and Document Number if used.
|
6 |
+
|
7 |
+
Give all outputs in json format for example {"option": "D", "explanation": "This is the explanation", "doc_no": "2,4"}
|
8 |
+
|