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 typing import List | |
import json | |
import sys | |
from langchain.chat_models import ChatOpenAI | |
from langchain.prompts import ChatPromptTemplate | |
from langchain.output_parsers import PydanticOutputParser | |
from langchain.schema.messages import HumanMessage, SystemMessage | |
from langchain.chains import ConversationChain | |
from langchain.memory import ConversationBufferMemory |
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
[tool.poetry] | |
name = "langchain" | |
version = "0.0.338" | |
description = "Building applications with LLMs through composability" | |
authors = [] | |
license = "MIT" | |
readme = "README.md" | |
repository = "https://github.com/langchain-ai/langchain" | |
[tool.poetry.scripts] |
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
# This is a Dockerfile for the Development Container | |
# see https://github.com/langchain-ai/langchain | |
# Use the Python base image | |
ARG VARIANT="3.11-bullseye" | |
FROM mcr.microsoft.com/devcontainers/python:0-${VARIANT} AS langchain-dev-base | |
USER vscode | |
# Define the version of Poetry to install (default is 1.4.2) |
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
test: malloc-release malloc-debug | |
./malloc-debug | |
./malloc-release | |
malloc-debug: MallocBenchmark.cpp | |
clang -O0 -D_DEBUG=1 -g -o malloc-debug MallocBenchmark.cpp | |
malloc-release: MallocBenchmark.cpp | |
clang -O3 -DNDEBUG=1 -o malloc-release MallocBenchmark.cpp |
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 torch | |
from imagen_pytorch import Unet, Imagen, ImagenTrainer | |
from imagen_pytorch.t5 import t5_encode_text, DEFAULT_T5_NAME | |
from torchvision import transforms | |
# This doesn't yet format the text embedding tensors right | |
# TODO: check out https://gist.github.com/Netruk44/38d793e6d04a53cc4d9acbfadbb04a5c | |
import json |
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
# Pick N random annotations from the list of annotations. | |
# Load/ccale/sample the corresponding image. | |
# Generate the T5 text embedding of the given prompt. | |
# Upload the data to the appropriate slot in each tensor. | |
def load_images(annots, pathsbyid, tensordim, t_embeds, t_masks, t_images): | |
# pick N random annotations | |
todo = annots.copy() | |
random.shuffle(todo) | |
todo = todo[0: tensordim] | |
for ix in range(0, tensordim): |
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 gave GPT3 a writing prompt, to see how well it would keep track of initial | |
conditions. | |
The writing that comes out is in the same ham-handed style as my prompt, it | |
gets 100% on that! But as a writer / prompt completer: | |
1. The conditions established in the first paragraph don't carry through -- there's | |
enough oxygen, so why's the air running out right away? | |
2. How can he feel the smell of the antenna array while in his suit on the moon? |
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
Trying to build on Ubuntu 17.04. | |
jwatte@ripper:~/Downloads/SlugDemo/Linux$ make | |
mkdir -p Output/Code | |
gcc -I../Code -I/usr/include -DSLUG_LINUX -DSLUG_OPENGL -m64 -msse -msse2 -std=c++11 -fno-exceptions -fno-rtti -Wall -Wno-multichar -Wno-strict-aliasing -Wno-unused-result -O3 -c ../Code/Main.cpp -o Output/Code/Main.o | |
gcc -I../Code -I/usr/include -DSLUG_LINUX -DSLUG_OPENGL -m64 -msse -msse2 -std=c++11 -fno-exceptions -fno-rtti -Wall -Wno-multichar -Wno-strict-aliasing -Wno-unused-result -O3 -c ../Code/SlugDemo.cpp -o Output/Code/SlugDemo.o | |
In file included from /usr/include/GL/glx.h:333:0, | |
from ../Code/SlugDemo.h:96, | |
from ../Code/Main.cpp:1: | |
/usr/include/GL/glxext.h:505:143: error: ‘GLintptr’ has not been declared |
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
class A a where | |
getB :: B b => a -> b | |
class B b where | |
getA :: A a => b -> a | |
data X = X | |
instance A X where | |
getB x = x |
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
-- AUTO-GENERATED, DO NOT EDIT !!! | |
data CampaignTemplateMaybe = CampaignTemplateMaybe | |
{ maybe_name :: !(Maybe Text) | |
, maybe_kind :: !(Maybe Text) | |
, maybe_definition :: !(Maybe Text) | |
, maybe_saved :: !(Maybe Bool) | |
, maybe_hidden :: !(Maybe Bool) | |
, maybe_last_active :: !(Maybe UTCTime) | |
} | |
deriving (Show, Read, Ord, Eq) |
NewerOlder