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 git # !pip install GitPython | |
import os | |
def download_repo_folder(repo_path, url, dirs_to_checkout, branch="main"): | |
# Initialize the repo (make sure the path is where you want to clone) | |
os.makedirs(repo_path, exist_ok=True) | |
repo = git.Repo.init(repo_path) |
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 numpy as np | |
import jax | |
import matplotlib.pyplot as plt | |
import jax.numpy as jnp | |
def inverse_square_root_schedule( | |
max_lr: float, | |
warmup_steps: int, | |
): | |
def schedule(count): |
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 pickle | |
import numpy as np | |
from tqdm import tqdm | |
import os | |
# Create a large numpy array and save it to a pickle file | |
# a = np.random.random((1000, 1000)) | |
a = np.random.random((40000,10000)) | |
with open('large_array.pkl', 'wb') as f: | |
pickle.dump(a, f) |
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
sudo ncdu / | |
sudo docker container ls -a --format '{{.ID}}:{{.Names}}' | xargs -I {} sh -c 'echo "Container {} ($(echo {} | cut -d: -f2)): $(sudo docker inspect --format "{{.GraphDriver.Data.MergedDir}}" $(echo {} | cut -d: -f1) | sed "s/\/merged$//") (Size: $(sudo du -sh $(sudo docker inspect --format "{{.GraphDriver.Data.MergedDir}}" $(echo {} | cut -d: -f1) | sed "s/\/merged$//") | cut -f1))"' | |
sudo docker image ls --format '{{.ID}}:{{.Repository}}:{{.Tag}}' | xargs -I {} sh -c 'echo "Image {} ($(echo {} | cut -d: -f2):$(echo {} | cut -d: -f3)): $(sudo docker inspect --format "{{.GraphDriver.Data.UpperDir}}" $(echo {} | cut -d: -f1) | sed "s/\/diff$//") (Size: $(sudo du -sh $(sudo docker inspect --format "{{.GraphDriver.Data.UpperDir}}" $(echo {} | cut -d: -f1) | sed "s/\/diff$//") | cut -f1))"' |
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 more_itertools | |
import itertools | |
""" | |
>>> create_named_matrix(2,3,5) | |
array([[['0,0,0', '0,0,1', '0,0,2', '0,0,3', '0,0,4'], | |
['0,1,0', '0,1,1', '0,1,2', '0,1,3', '0,1,4'], | |
['0,2,0', '0,2,1', '0,2,2', '0,2,3', '0,2,4']], | |
[['1,0,0', '1,0,1', '1,0,2', '1,0,3', '1,0,4'], | |
['1,1,0', '1,1,1', '1,1,2', '1,1,3', '1,1,4'], |
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
namespace functions { | |
// Execute a block of Python code. This can be used to perform calculations, process data, or any other task that can be accomplished through Python code. | |
type python = (_: { | |
code: string, | |
}) => any; | |
// Create images from a text-only prompt. This tool is used to generate visual content based on detailed descriptions provided in text form. | |
type dalle = (_: { | |
size?: "1792x1024" | "1024x1024" | "1024x1792", |
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 more_itertools import windowed, repeat_last | |
import numpy as np | |
from more_itertools import grouper | |
input_ids = np.arange(65) | |
# input_ids = np.arange(4097) | |
width = 16 | |
stride = 4 |
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
sudo apt-get update -y | |
# Add Docker's official GPG key: | |
sudo apt-get purge -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras | |
sudo rm -rf /var/lib/docker | |
sudo rm -rf /var/lib/containerd | |
sudo apt-get update | |
sudo apt-get install -y ca-certificates curl gnupg | |
sudo install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg |
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
openapi: 3.1.0 | |
info: | |
contact: | |
name: StackQL Studios | |
url: https://github.com/stackql/google-discovery-to-openapi | |
email: info@stackql.io | |
title: Cloud TPU API | |
description: TPU API provides customers with access to Google TPU technology. | |
version: v2 | |
x-discovery-doc-revision: '20231026' |
This file has been truncated, but you can view the full 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
<html> | |
<head><meta charset="utf-8" /></head> | |
<body> | |
<div> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script> | |
<script type="text/javascript">/** | |
* plotly.js v2.24.1 | |
* Copyright 2012-2023, Plotly, Inc. | |
* All rights reserved. | |
* Licensed under the MIT license |
NewerOlder