Skip to content

Instantly share code, notes, and snippets.

View GzuPark's full-sized avatar
🍀
just enjoy your playing

Jongmin Park GzuPark

🍀
just enjoy your playing
View GitHub Profile
@ariG23498
ariG23498 / flux-dev-under-8gbs.py
Created October 20, 2024 09:01
Run FLUX Dev under 8gbs of VRAM.
# Taken from: https://gist.github.com/sayakpaul/23862a2e7f5ab73dfdcc513751289bea
from diffusers import FluxPipeline, FluxTransformer2DModel
from transformers import T5EncoderModel
import torch
import gc
def flush():
gc.collect()
@juanmc2005
juanmc2005 / diart_whisper.py
Last active November 17, 2024 18:24
Code for my tutorial "Color Your Captions: Streamlining Live Transcriptions with Diart and OpenAI's Whisper". Available at https://medium.com/@juanmc2005/color-your-captions-streamlining-live-transcriptions-with-diart-and-openais-whisper-6203350234ef
import logging
import os
import sys
import traceback
from contextlib import contextmanager
import diart.operators as dops
import numpy as np
import rich
import rx.operators as ops
@GzuPark
GzuPark / pytorch.Dockerfile
Created February 3, 2022 08:20
Sample Dockerfiles for TensorFlow & PyTorch
ARG UBUNTU_VERSION=20.04
ARG CUDA_VERSION=11.3.1
ARG CUDA=11.3
ARG CUDNN_VERSION=8
FROM nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu${UBUNTU_VERSION}
LABEL maintainer "http://gzupark.dev"
ARG CUDA_VERSION
ARG CUDA
@ychoi-kr
ychoi-kr / install_konlpy.py
Created November 26, 2021 10:24
KoNLPy 최신 버전 설치
import os
from urllib.parse import urlparse
import urllib.request
import zipfile
import tempfile
from subprocess import call
zip_url = 'https://github.com/konlpy/konlpy/archive/refs/heads/master.zip'
dirname = 'konlpy-master'
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
import tensorflow as tf
model_name = 'bert-base-cased'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = TFAutoModelForSequenceClassification.from_pretrained(model_name, num_labels=2)
texts = ["I'm a positive example!", "I'm a negative example!"]
labels = [1, 0]
@baby-bird
baby-bird / Time_Timer.py
Last active March 8, 2024 21:48
Time_Timer.py
'''
A simple Time Timer app made of ShapeNodes.
<Change Line 120 for seconds or minutes counting>
<Uncomment Line 126 and fill in your shortcut name to
automatically run other shortcut you defined
after timer stopped>
Odd touch attemps will start the timer
Even touch attemps will stop the timer
Stops automatically when the set times passed
'''
@docPhil99
docPhil99 / opencv_qt_label.md
Last active August 31, 2024 13:14
How to display opencv video in pyqt apps

The code for this tutorial is here

Opencv provides are useful, but limited, method of building a GUI. A much more complete system could be acheived using pyqt. The question is, how do we display images. There are quite a few possible routes but perhaps the easiest is to use QLabel since it has a setPixmap function. Below is some code that creates two labels. It then creates a grey pixmap and displays it one of the labels. code: staticLabel1.py

from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QVBoxLayout
from PyQt5.QtGui import QPixmap, QColor
import sys
@tvst
tvst / SessionState.py
Last active September 30, 2024 07:47
DO NOT USE!!! Try st.session_state instead.
"""Hack to add per-session state to Streamlit.
Usage
-----
>>> import SessionState
>>>
>>> session_state = SessionState.get(user_name='', favorite_color='black')
>>> session_state.user_name
''
@dojoteef
dojoteef / profile.py
Last active June 5, 2023 11:44
A CUDA memory profiler for pytorch
'''
Memory profiling utilities
'''
import gc
import inspect
import linecache
import os.path
import sys
import time
import threading
@udkyo
udkyo / Dockerfile
Last active May 1, 2024 12:51
Basic container for X11 forwarding goodness
FROM ubuntu
RUN apt update \
&& apt install -y firefox \
openssh-server \
xauth \
&& mkdir /var/run/sshd \
&& mkdir /root/.ssh \
&& chmod 700 /root/.ssh \
&& ssh-keygen -A \
&& sed -i "s/^.*PasswordAuthentication.*$/PasswordAuthentication no/" /etc/ssh/sshd_config \