Spaces:
Runtime error
Runtime error
Download core/graph_engine.py from derangedsaturnian/workflow-agent: direct link, hf CLI and curl.
- Browser
- Download file 504 Bytes
-
https://huggingface.co/spaces/derangedsaturnian/workflow-agent/resolve/refs%2Fpr%2F1/core/graph_engine.py
- Command line
-
hf download hf://spaces/derangedsaturnian/workflow-agent@refs/pr/1/core/graph_engine.py
-
curl -L -o graph_engine.py https://huggingface.co/spaces/derangedsaturnian/workflow-agent/resolve/refs%2Fpr%2F1/core/graph_engine.py
504 Bytes
| #from llama_index.core import KnowledgeGraphIndex,StorageContext | |
| #from llama_index.core.graph_stores import SimpleGraphStore | |
| from llama_index.core import VectorStoreIndex | |
| def build_graph_idx(docs): | |
| #graph_store=SimpleGraphStore() | |
| #storage_context=StorageContext.from_defaults(graph_store=graph_store) | |
| #idx=KnowledgeGraphIndex.from_documents(docs,max_triplets_per_chunk=3,storage_context=storage_context,include_embeddings=True) | |
| idx = VectorStoreIndex.from_documents(docs) | |
| return idx |