knox / LlamaIndex-readme-4.py
0 likes
0 forks
1 files
Last active
1 | import os |
2 | |
3 | os.environ["REPLICATE_API_TOKEN"] = "YOUR_REPLICATE_API_TOKEN" |
4 | |
5 | from llama_index.core import Settings, VectorStoreIndex, SimpleDirectoryReader |
6 | from llama_index.embeddings.huggingface import HuggingFaceEmbedding |
7 | from llama_index.llms.replicate import Replicate |
8 | from transformers import AutoTokenizer |
9 | |
10 | # set the LLM |
knox / LlamaIndex-readme-3.py
0 likes
0 forks
1 files
Last active
1 | import os |
2 | |
3 | os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY" |
4 | |
5 | from llama_index.core import VectorStoreIndex, SimpleDirectoryReader |
6 | |
7 | documents = SimpleDirectoryReader("YOUR_DATA_DIRECTORY").load_data() |
8 | index = VectorStoreIndex.from_documents(documents) |
knox / LlamaIndex-readme-2.sh
0 likes
0 forks
1 files
Last active
1 | # custom selection of integrations to work with core |
2 | pip install llama-index-core |
3 | pip install llama-index-llms-openai |
4 | pip install llama-index-llms-replicate |
5 | pip install llama-index-embeddings-huggingface |
knox / LlamaIndex-readme-1.py
0 likes
0 forks
1 files
Last active
1 | # typical pattern |
2 | from llama_index.core.xxx import ClassABC # core submodule xxx |
3 | from llama_index.xxx.yyy import ( |
4 | SubclassABC, |
5 | ) # integration yyy for submodule xxx |
6 | |
7 | # concrete example |
8 | from llama_index.core.llms import LLM |
9 | from llama_index.llms.openai import OpenAI |
knox / swift-readme-6.sh
0 likes
0 forks
1 files
Last active
1 | $ sudo tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx-symbols.tar.gz -C / |
2 | $ tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx-symbols.tar.gz -C ~/ |
knox / swift-readme-5.sh
0 likes
0 forks
1 files
Last active
1 | $ sudo tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz -C / |
2 | $ tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz -C ~/ |
knox / swift-readme-4.sh
0 likes
0 forks
1 files
Last active
1 | $ ./swift/utils/build-toolchain $BUNDLE_PREFIX |
knox / swift-readme-3.md
0 likes
0 forks
1 files
Last active
OS | Architecture | Build |
---|---|---|
Android | ARMv7 | |
Android | AArch64 | |
Windows 2019 (VS 2019) | x86_64 |
knox / swift-readme-2.md
0 likes
0 forks
1 files
Last active
knox / swift-readme-1.md
0 likes
0 forks
1 files