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 requests | |
from tqdm import tqdm | |
import feedparser | |
from bs4 import BeautifulSoup | |
from time import sleep | |
import os | |
from pprint import pprint | |
#!python3 -m pip install feedparser | |
def fancy_message(tag, body): |
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 transformers import GPT2Tokenizer, GPT2Model | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from matplotlib.animation import FuncAnimation | |
def get_model_info(model): | |
num_layers = model.config.n_layer | |
num_heads = model.config.n_head | |
hidden_dim = model.config.n_embd |
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
def fancy_message(tag, body): | |
tags = [ | |
("FATAL", "☠️", "\033[91m"), # Red color for FATAL | |
("WARN", "🚨", "\033[93m"), # Yellow color for WARN | |
("INFO", "ℹ️", "\033[94m"), # Blue color for INFO | |
("WAIT", "☕️", "\033[96m") # Cyan color for WAIT | |
] | |
matching_tags = [x for x in tags if x[0] == tag.upper()] | |
if matching_tags: |
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 requests | |
import io | |
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter | |
from pdfminer.converter import TextConverter | |
from pdfminer.layout import LAParams | |
from pdfminer.pdfpage import PDFPage | |
import re | |
import torch | |
import termcolor | |
from transformers import AutoTokenizer, AutoModel, AutoModelForSequenceClassification |
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
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v2.3.0 | |
hooks: | |
- id: check-yaml | |
- id: end-of-file-fixer | |
- id: trailing-whitespace | |
- id: mixed-line-ending | |
- repo: https://github.com/psf/black | |
rev: 22.10.0 |
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
#!/bin/bash | |
REGEX="(feat|fix|docs|ui|chore|locale)\((refactor|perf|workflow|build|CI|typos|tests|types|wip|release|dep)\):\s.+" | |
if ! grep -iqE "$REGEX" "$1"; then | |
echo "Invalid commit message format. Use the following format: [emoji] [revert: ?]<type>[(scope)?]: <message>" | |
echo "e.g. '🎨 feat(workflow): Added commit-msg hook'" | |
exit 1 | |
else | |
pre-commit | |
fi |
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 openpyxl | |
from docx import Document | |
def stupid_tax(x): | |
try: | |
x = x.split('.')[0] | |
return x | |
except: | |
return x |