Skip to content

Instantly share code, notes, and snippets.

View AntreasAntoniou's full-sized avatar
🏠
Exploring the unknown

Antreas Antoniou AntreasAntoniou

🏠
Exploring the unknown
View GitHub Profile
@AntreasAntoniou
AntreasAntoniou / huggingface_upload_download_parallel.py
Last active May 3, 2024 11:10
A script that automates upload and download using parallel workers with the huggingface api
# Python Package Imports
import os
import multiprocessing as mp
try:
import fire
from tqdm.auto import tqdm
from huggingface_hub import HfApi, hf_hub
except ImportError as e:
# Handle missing library
@AntreasAntoniou
AntreasAntoniou / starship.config
Last active June 2, 2024 17:23
Awesome Starship Config: Creativity, Warmth, and Efficiency
# Use a light bulb as the prompt symbol 💡, symbolizing creativity
[character]
success_symbol = "[💡](bold green)"
error_symbol = "[💔](bold red)"
# Add 🎨 when in a git repository, symbolizing the art of coding
[git_branch]
symbol = "🎨"
format = "($symbol$branch)"
@AntreasAntoniou
AntreasAntoniou / hf_set_to_private.py
Created May 4, 2023 18:03
Automatically set all huggingface user repos to private
import requests
from huggingface_hub import Repository, HfApi
if __name__ == "__main__":
import os
from rich import print
@AntreasAntoniou
AntreasAntoniou / async_dataloading.py
Created March 25, 2023 23:37
A gist showing how one can have a list of dataloaders asynchronously yielded from
import asyncio
import queue
import threading
from typing import List
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
import tqdm
@AntreasAntoniou
AntreasAntoniou / vit_tiny_84x84.py
Last active March 6, 2023 15:56
ViT tiny demo
from rich import print
import timm
import torch
import tqdm
model_names = ["vit_base_patch32_224_clip_laion2b", "vit_tiny_patch16_224_in21k"]
model = timm.create_model(
"vit_base_patch32_224_clip_laion2b", pretrained=True, in_chans=3, img_size=84
).to(torch.cuda.current_device())
@AntreasAntoniou
AntreasAntoniou / PlayStationBIOSFilesNAEUJP.md
Created November 30, 2022 07:16 — forked from juanbrujo/PlayStationBIOSFilesNAEUJP.md
Files for PlayStation BIOS Files NA-EU-JP
@AntreasAntoniou
AntreasAntoniou / docker-aliases.sh
Created October 8, 2022 19:55 — forked from jgrodziski/docker-aliases.sh
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
@AntreasAntoniou
AntreasAntoniou / multi_process_arrow_parquet_example.py
Created October 6, 2022 16:29
multi_process_arrow_parquet_example.py
import shutil
import concurrent
import pyarrow.parquet as pq
import pyarrow as pa
import pyarrow.dataset as ds
import numpy as np
import pandas as pd
import pathlib
import pyarrow.parquet as pq
import pyarrow as pa
import pyarrow.dataset as ds
import numpy as np
import pandas as pd
import pathlib
from rich import print
import tqdm
total_iters = 10000
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.
com/uc?export=download&id=0B7EVK8r0v71pZjFTYXZWM3FlRnM' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=0B7EVK8r0v71pZjFTYXZWM3FlRnM" -O celeba.zip && rm -rf /tmp/cookies.txt