-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into check-streamable
- Loading branch information
Showing
45 changed files
with
295 additions
and
119 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Use Nvidia Ubuntu 20 base (includes CUDA if a supported GPU is present) | ||
# https://hub.docker.com/r/nvidia/cuda | ||
FROM nvidia/cuda:11.6.2-cudnn8-devel-ubuntu20.04@sha256:55211df43bf393d3393559d5ab53283d4ebc3943d802b04546a24f3345825bd9 | ||
|
||
ARG USERNAME | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
# Create the user | ||
# https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user | ||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
&& usermod -a -G video user \ | ||
&& apt-get update \ | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install dependencies | ||
RUN apt-get update && \ | ||
apt-get -qq -y install \ | ||
software-properties-common && \ | ||
add-apt-repository ppa:deadsnakes/ppa && \ | ||
apt-get update && \ | ||
apt-get -qq -y install \ | ||
build-essential \ | ||
python3.10 \ | ||
python3.10-dev \ | ||
python3.10-distutils \ | ||
python3.10-venv \ | ||
curl \ | ||
git \ | ||
tmux | ||
|
||
# Update package list, add the deadsnakes PPA, and install dependencies | ||
|
||
|
||
ENV PATH="$HOME/.local/bin:$PATH" | ||
|
||
# Install pip (we need the latest version not the standard Ubuntu version, to | ||
# support modern wheels) | ||
RUN sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3.10 get-pip.py | ||
|
||
# Set python aliases | ||
RUN sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 | ||
RUN sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 | ||
|
||
# User the new user | ||
USER $USERNAME |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "Python 3", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
"USERNAME": "user" | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.formatting.autopep8Path": "autopep8", | ||
"python.linting.mypyPath": "mypy", | ||
"terminal.integrated.defaultProfile.linux": "tmux", | ||
"terminal.integrated.profiles.linux": { | ||
"bash": { | ||
"path": "bash", | ||
"icon": "terminal-bash" | ||
}, | ||
"tmux": { | ||
"path": "bash", | ||
"args": ["-c", "tmux new -ADs ${PWD##*/}"], | ||
"icon": "terminal-tmux" | ||
} | ||
} | ||
}, | ||
"extensions": [ | ||
"davidanson.vscode-markdownlint", | ||
"donjayamanne.githistory", | ||
"donjayamanne.python-extension-pack", | ||
"github.vscode-pull-request-github", | ||
"ms-python.python", | ||
"ms-toolsai.jupyter", | ||
"ms-vsliveshare.vsliveshare-pack", | ||
"njpwerner.autodocstring", | ||
"stkb.rewrap", | ||
"streetsidesoftware.code-spell-checker", | ||
"tushortz.python-extended-snippets", | ||
"yzhang.markdown-all-in-one", | ||
"elagil.pre-commit-helper", | ||
"eamodio.gitlens" | ||
] | ||
} | ||
}, | ||
"containerUser": "user", | ||
"postCreateCommand": "pip install -e .[dev] --no-warn-script-location" | ||
} |
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from .extraction import extract_hiddens, Extract | ||
from .extraction import Extract, extract_hiddens | ||
|
||
__all__ = ["extract_hiddens", "Extract"] |
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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
from .balanced_sampler import BalancedSampler, FewShotSampler | ||
from .extraction import Extract, extract_hiddens, extract | ||
from .generator import _GeneratorConfig, _GeneratorBuilder | ||
from .extraction import Extract, extract, extract_hiddens | ||
from .generator import _GeneratorBuilder, _GeneratorConfig | ||
from .prompt_loading import PromptConfig, yield_prompts | ||
|
||
__all__ = [ | ||
"_GeneratorBuilder", | ||
"_GeneratorConfig", | ||
"BalancedSampler", | ||
"extract_hiddens", | ||
"extract", | ||
"Extract", | ||
"FewShotSampler", | ||
"PromptConfig", | ||
"yield_prompts", | ||
] |
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 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 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
Empty file.
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import logging | ||
|
||
from .utils import select_train_val_splits | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
from torch import Tensor | ||
import math | ||
import random | ||
|
||
import torch | ||
from torch import Tensor | ||
|
||
|
||
@torch.jit.script | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import re | ||
|
||
from .training.losses import LOSSES | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from .templates import DatasetTemplates, Template | ||
|
||
__all__ = ["DatasetTemplates", "Template"] |
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
Oops, something went wrong.