Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
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
# Clone llama.cpp | |
git clone https://github.com/ggerganov/llama.cpp.git | |
cd llama.cpp | |
# Build it | |
make clean | |
LLAMA_METAL=1 make | |
# Download model | |
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin |
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
# I couldn't get return generators from chains so I had to do a bit of low level SSE, Hope this is useful | |
# Probably you'll use another Vector Store instead of OpenSearch, but if you want to mimic what I did here, | |
# please use the fork of `OpenSearchVectorSearch` in https://github.com/oneryalcin/langchain | |
import json | |
import os | |
import logging | |
from typing import List, Generator |
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
import os | |
os.environ["OPENAI_API_KEY"] = "" | |
from flask import Flask, Response, request | |
import threading | |
import queue | |
from langchain.chat_models import ChatOpenAI | |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler | |
from langchain.schema import AIMessage, HumanMessage, SystemMessage |
Important: This microbenchmark is not intended to represent any real workload. Compression ratios, and therefore performance, will depend heavily on the specific workload. This is only for the purpose of illustrating a "columnar friendly" contrived workload that showcases the benefits of columnar.
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
/** | |
* Parse Airtable's "ConstantPooledData" format. They recently started using | |
* this format to compress some API responses, and it appears to be a | |
* home-grown format. | |
* | |
* Call `parseData()` if you have an object with data (e.g. a JSON-parsed API | |
* response body). | |
* | |
* Call `parseString()` if you have a raw string of data (e.g. an API response | |
* body). |
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
<%= form_with(model: team) do |form| %> | |
<div> | |
<%= form.label :name %> | |
<%= form.text_field :name, class: "input" %> | |
</div> | |
<div> | |
<%= f.select :user_id, {}, {placeholder: "Select user"}, {class: "w-full", data: { controller: "select", select_url_value: users_path }} %> | |
</div> |
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
import requests | |
#Fetch existing tables | |
tables = requests.post('http://localhost:8080/v1/query', json={ | |
"type":"select", | |
"args":{ | |
"table": {"schema": "information_schema", "name": "tables"}, | |
"columns": ["table_name"], | |
"where": {"table_schema": {"$eq": "public"}} | |
} |
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
#!/bin/bash | |
## Install and Setup TiDB on Linux | |
## https://github.com/pingcap/tidb | |
## https://github.com/pingcap/docs/blob/master/sql/privilege.md | |
## https://pingcap.com/blog/2016-10-17-how-we-build-tidb/ | |
useradd tidb -d /var/lib/tidb -m | |
usermod -a -G tidb tidb | |
cd /var/lib/tidb |
NewerOlder