Skip to content

Instantly share code, notes, and snippets.

@xinqiu
xinqiu / bot.py
Created April 9, 2023 11:37
Creating a private data QA bot entirely using the open-source LLM project
from langchain import PromptTemplate, LLMChain
from langchain.document_loaders import UnstructuredHTMLLoader
from langchain.embeddings import LlamaCppEmbeddings
from langchain.llms import LlamaCpp
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.vectorstores.faiss import FAISS
loader = UnstructuredHTMLLoader("langchain/docs/_build/html/index.html")
embedding = LlamaCppEmbeddings(model_path="path/models/ggml-model-q4_0.bin")
llm = LlamaCpp(model_path="path/models/ggml-model-q4_0.bin")
@xinqiu
xinqiu / README.txt
Created June 6, 2022 15:23
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX DEFAULT WORKSPACE
Remix default workspace is present when:
i. Remix loads for the very first time
ii. A new workspace is created
iii. There are no files existing in the File Explorer
This workspace contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.