Spaces:
Running
Running
To v0.6.0; use embed_openai store
Browse files- app.py +1 -1
- corpus_query.py +5 -2
- openworm.ai_store/default__vector_store.json +0 -3
- openworm.ai_store/docstore.json +0 -3
- openworm.ai_store/graph_store.json +0 -3
- openworm.ai_store/image__vector_store.json +0 -3
- openworm.ai_store/index_store.json +0 -3
- store/embed_openai/docstore.json +0 -0
- store/embed_openai/graph_store.json +1 -0
- store/embed_openai/image__vector_store.json +1 -0
- store/embed_openai/index_store.json +0 -0
app.py
CHANGED
|
@@ -14,7 +14,7 @@ from openworm_ai.utils.llms import OPENAI_LLMS
|
|
| 14 |
|
| 15 |
import socket
|
| 16 |
|
| 17 |
-
__version__ = "0.
|
| 18 |
|
| 19 |
|
| 20 |
def requires_openai_key(llm_ver):
|
|
|
|
| 14 |
|
| 15 |
import socket
|
| 16 |
|
| 17 |
+
__version__ = "0.6.0"
|
| 18 |
|
| 19 |
|
| 20 |
def requires_openai_key(llm_ver):
|
corpus_query.py
CHANGED
|
@@ -17,7 +17,8 @@ LLM_GPT4o = "GPT4o"
|
|
| 17 |
def print_(text):
|
| 18 |
print(text)
|
| 19 |
|
| 20 |
-
|
|
|
|
| 21 |
def load_index(model):
|
| 22 |
OLLAMA_MODEL = model.replace("Ollama:", "") if model is not LLM_GPT4o else None
|
| 23 |
|
|
@@ -43,7 +44,7 @@ def load_index(model):
|
|
| 43 |
|
| 44 |
index_reloaded = load_index_from_storage(storage_context)
|
| 45 |
|
| 46 |
-
return index_reloaded
|
| 47 |
|
| 48 |
|
| 49 |
def get_query_engine(index_reloaded, model, similarity_top_k=4):
|
|
@@ -131,6 +132,7 @@ def process_query(query, model=llm_ver):
|
|
| 131 |
files_used = []
|
| 132 |
for sn in response.source_nodes:
|
| 133 |
# print(sn)
|
|
|
|
| 134 |
sd = sn.metadata["source document"]
|
| 135 |
if "et_al_" in sd:
|
| 136 |
sd = sd.replace("WormAtlas Handbook:", "Paper: ")
|
|
@@ -182,6 +184,7 @@ if __name__ == "__main__":
|
|
| 182 |
queries = [
|
| 183 |
"What are the main types of neurons and muscles in the C. elegans pharynx?",
|
| 184 |
"Tell me about the egg laying apparatus",
|
|
|
|
| 185 |
]
|
| 186 |
|
| 187 |
for query in queries:
|
|
|
|
| 17 |
def print_(text):
|
| 18 |
print(text)
|
| 19 |
|
| 20 |
+
from openworm_ai.graphrag.GraphRAG_test import load_index
|
| 21 |
+
'''
|
| 22 |
def load_index(model):
|
| 23 |
OLLAMA_MODEL = model.replace("Ollama:", "") if model is not LLM_GPT4o else None
|
| 24 |
|
|
|
|
| 44 |
|
| 45 |
index_reloaded = load_index_from_storage(storage_context)
|
| 46 |
|
| 47 |
+
return index_reloaded'''
|
| 48 |
|
| 49 |
|
| 50 |
def get_query_engine(index_reloaded, model, similarity_top_k=4):
|
|
|
|
| 132 |
files_used = []
|
| 133 |
for sn in response.source_nodes:
|
| 134 |
# print(sn)
|
| 135 |
+
print(sn.metadata)
|
| 136 |
sd = sn.metadata["source document"]
|
| 137 |
if "et_al_" in sd:
|
| 138 |
sd = sd.replace("WormAtlas Handbook:", "Paper: ")
|
|
|
|
| 184 |
queries = [
|
| 185 |
"What are the main types of neurons and muscles in the C. elegans pharynx?",
|
| 186 |
"Tell me about the egg laying apparatus",
|
| 187 |
+
"Tell me about locomotion in C. elegans",
|
| 188 |
]
|
| 189 |
|
| 190 |
for query in queries:
|
openworm.ai_store/default__vector_store.json
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:3b0017f9d77d51651eb4d2c45f08128c9702d15deb6a8a1bd619c80c66b0cebf
|
| 3 |
-
size 13779731
|
|
|
|
|
|
|
|
|
|
|
|
openworm.ai_store/docstore.json
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:ad8615ba2fbc0fb330fec021f32d258af73e7cf353f5c43f2df2b3a2d0afb93b
|
| 3 |
-
size 2187676
|
|
|
|
|
|
|
|
|
|
|
|
openworm.ai_store/graph_store.json
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:8e0a77744010862225c69da83c585f4f8a42fd551b044ce530dbb1eb6e16742c
|
| 3 |
-
size 18
|
|
|
|
|
|
|
|
|
|
|
|
openworm.ai_store/image__vector_store.json
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:d17ed74c1649a438e518a8dc56a7772913dfe1ea7a7605bce069c63872431455
|
| 3 |
-
size 72
|
|
|
|
|
|
|
|
|
|
|
|
openworm.ai_store/index_store.json
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:584307257581210ab2b3f426cb81983b71f8471071b2495e1f804dfd206a3f12
|
| 3 |
-
size 33427
|
|
|
|
|
|
|
|
|
|
|
|
store/embed_openai/docstore.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
store/embed_openai/graph_store.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"graph_dict": {}}
|
store/embed_openai/image__vector_store.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"embedding_dict": {}, "text_id_to_ref_doc_id": {}, "metadata_dict": {}}
|
store/embed_openai/index_store.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|