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 argparse | |
import torch | |
from torch.nn.functional import gelu, layer_norm, softmax | |
from transformers import GPT2Model, AutoTokenizer | |
from typing import TypedDict | |
MODEL_NAME = "gpt2" | |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
model = GPT2Model.from_pretrained(MODEL_NAME).to(device) |
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 argparse | |
import torch | |
from torch.nn.functional import gelu, layer_norm, softmax | |
from transformers import GPT2Model, AutoTokenizer | |
from typing import TypedDict | |
MODEL_NAME = "gpt2" | |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
model = GPT2Model.from_pretrained(MODEL_NAME).to(device) |
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 abc | |
def truncate(n: int, decimals: int = 18) -> float: | |
return n / (10 ** decimals) | |
def apy(ratePerBlock: int) -> float: | |
return ((((((ratePerBlock / 1e18) * 6570) + 1) ** 365)) - 1) * 100 |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity ^0.7.6; | |
pragma abicoder v2; | |
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
import { IUniswapV3FlashCallback } from "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3FlashCallback.sol"; | |
import { IUniswapV3Pool } from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; | |
import { ISwapRouter } from "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol"; | |
import { LowGasSafeMath } from "@uniswap/v3-core/contracts/libraries/LowGasSafeMath.sol"; | |
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; |
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
### Begin Global.gitignore (https://github.com/github/gitignore) | |
### https://gist.github.com/gg2001/6a838a9bbae3138e0a2f7c1712058708 | |
## macOS.gitignore | |
# General | |
.DS_Store | |
.AppleDouble | |
.LSOverride |