This file contains hidden or 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
const privateKeyArray = [18, 245, 33, 87, 214, 128, 45, 87, 213, 98, 34, 64, 23, 12, 87, 213, 98, 34, 64, 23, 12, 87, 213, 98, 34, 64, 23, 12, 87, 213, 98, 34, 64, 23, 12, 87, 213, 98, 34, 64, 23, 12, 87, 213, 98, 34, 64, 23, 12, 87, 213, 98, 34, 64, 23, 12, 87, 213, 98, 34, 64, 23, 12, 87, 213, 98, 34, 64, 23]; | |
const privateKeyUint8Array = new Uint8Array(privateKeyArray); | |
const BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; | |
function encodeBase58(uint8Array) { | |
let digits = [0]; | |
for (let i = 0; i < uint8Array.length; i++) { | |
for (let j = 0; j < digits.length; j++) digits[j] <<= 8; | |
digits[0] += uint8Array[i]; |
This file contains hidden or 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
// Define the URLs to be intercepted and their respective replacements | |
const URL_MAP = { | |
'https://base-mainnet.g.alchemy.com/v2/tgXc05yLe8pJDawEM3OZZdMYD8i29Qsi': 'https://virtual.base.rpc.tenderly.co/{CHANGE WITH YOUR KEY}', | |
'wss://base-mainnet.g.alchemy.com/v2/tgXc05yLe8pJDawEM3OZZdMYD8i29Qsi': 'wss://virtual.base.rpc.tenderly.co/{CHANGE WITH YOUR KEY}' | |
}; | |
// Helper function to get the redirected URL | |
function getRedirectedUrl(url) { | |
for (const [original, replacement] of Object.entries(URL_MAP)) { | |
if (url.includes(original)) { |
This file contains hidden or 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
# Credit 🙏: I just used the example from langchain docs and it works quite well: https://python.langchain.com/en/latest/use_cases/question_answering.html | |
# Note 2: The Arxiv -> PDF logic is a bit messy, I'm sure it can be done better | |
# Note 3: Please install the following: | |
# To run: | |
# Save this in a `app.py` | |
# pip install arxiv PyPDF2 langchain chromadb | |
# The chat feature was shipped in H2O nightly this week, we will need to install from nightly link: |
This file contains hidden or 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["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152 | |
os.environ["CUDA_VISIBLE_DEVICES"]="0" |
This file contains hidden or 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 fastai.basics import ItemBase, ItemList, Iterator, Collection, Callable, LabelList, Any, IntsOrStrs, listify, show_some, array, extract_kwargs | |
from fastai.vision import ImageDataBunch, ImageItemList | |
from fastai.data_block import PreProcessors, PreProcessor | |
class MultiLabelProcessor(PreProcessor): | |
def __init__(self, ds:Collection=None): | |
self.ref_ds = ds | |
self.procs_y = [] | |
def process(self, ds:Collection=None): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 math import floor | |
def conv_output_shape(h_w, kernel_size=1, stride=1, pad=0, dilation=1): | |
if type(kernel_size) is not tuple: | |
kernel_size = (kernel_size, kernel_size) | |
if type(stride) is not tuple: | |
stride = (stride, stride) | |
if type(pad) is not tuple: | |
pad = (pad, pad) | |
if type(dilation) is not tuple: |
This file contains hidden or 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
41.63.128.0/19 | |
196.43.214.0/24 | |
196.46.158.148/30 | |
196.46.158.192/30 | |
196.49.13.0/24 | |
196.192.32.0/20 | |
196.223.41.0/24 | |
197.148.128.0/18 | |
197.149.0.0/18 | |
197.158.64.0/18 |
This file contains hidden or 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
name: "SENet" | |
# mean_value: 104, 117, 123 | |
layer { | |
name: "data" | |
type: "Input" | |
top: "data" | |
input_param: { | |
shape: { | |
dim: 1 | |
dim: 3 |
This file contains hidden or 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 SaveBestModel(LossRecorder): | |
""" Save weights of the best model based during training. | |
If metrics are provided, the first metric in the list is used to | |
find the best model. | |
If no metrics are provided, the loss is used. | |
Args: | |
model: the fastai model | |
lr: indicate to use test images; otherwise use validation images |