This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ragatouille import RAGPretrainedModel | |
import json, cmd, ollama # pip install ollama | |
# first, install ollama: | |
# curl -fsSL https://ollama.com/install.sh | sh | |
# second, download llama2:chat: | |
# ollama run llama2:chat | |
llm = "llama2:chat" | |
llm_context_size = 8192 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ragatouille import RAGPretrainedModel | |
import os, glob | |
RAG = RAGPretrainedModel.from_pretrained("colbert-ir/colbertv2.0") | |
def create_document_corpus(folderpath: str, filetype: str = "txt"): | |
my_documents = [] | |
document_ids = [] | |
document_metadatas = [] | |
for i, filepath in enumerate(glob.glob(os.path.join(folderpath, f"**/*.{filetype}"), recursive=True)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ported from c to python only using github copilot (no google) | |
from ctypes import windll | |
from ctypes import c_int | |
from ctypes import c_uint | |
from ctypes import c_ulong | |
from ctypes import POINTER | |
from ctypes import byref | |
nullptr = POINTER(c_int)() |