Skip to content

Instantly share code, notes, and snippets.

View rolisz's full-sized avatar

Roland Szabo rolisz

View GitHub Profile
@rolisz
rolisz / gpu_monitoring.py
Created November 21, 2018 13:07
Script to send GPU monitoring data obtained with nvidia-smi to Stackdriver.
from subprocess import Popen, PIPE
import os
import time
import sys
def compute_stats():
all_gpu = []
all_mem = []
for i in range(10):
p = Popen(["nvidia-smi","--query-gpu=utilization.gpu,utilization.memory", "--format=csv,noheader,nounits"], stdout=PIPE)
@rolisz
rolisz / Cargo.toml
Last active May 24, 2023 09:48
Simple web crawler in Rust
[package]
name = "rust_crawler"
version = "0.1.0"
authors = ["Roland Szabo <rolisz@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
reqwest = { version = "0.10", features = ["json", "blocking"] }
@rolisz
rolisz / manual_patterns.py
Created May 24, 2022 12:17
Prodigy pattern for multi-label text classification using patterns, without a model in the loop.
import copy
from typing import Union, Iterable, Optional, List
import spacy
from prodigy import recipe, log, get_stream
from prodigy.models.matcher import PatternMatcher
from prodigy.types import RecipeSettingsType
from prodigy.util import get_labels
@rolisz
rolisz / min_pattern_error.py
Last active June 13, 2022 10:23
Reproduction for PatternMatcher bug
from typing import Union, Iterable, Optional, List
import spacy
from prodigy import recipe, get_stream
from prodigy.models.matcher import PatternMatcher
from prodigy.types import RecipeSettingsType
from prodigy.util import get_labels
@recipe(
@rolisz
rolisz / mic_check.py
Created February 2, 2023 15:41
Script to alert on microphone loudness
import time
from collections import deque
import numpy as np
import sounddevice as sd
from beepy import beep
from infi.systray import SysTrayIcon
last_alert = time.time() - 10
q = deque(maxlen=200)