Skip to content

Instantly share code, notes, and snippets.

@matbee-eth
matbee-eth / log.txt
Last active May 1, 2024 20:16
Parser for the CSV dataset at google-research-datasets/screen_annotation
(base) ➜ screen_annotation git:(main) ✗ python parse_dataset_entry.py
[('TOOLBAR', 0, 999, 31, 109, [('Inbox', 40, 158, 54, 85)]), ('CHATROOMS', 0, 333, 108, 171), ('NAVIGATION_BAR', 0, 998, 109, 171, [('DIRECT', 331, 664, 109, 171), ('CONTACTS', 672, 998, 110, 173)]), ('Inbox', 193, 409, 194, 222), ('Message', 273, 539, 226, 252), ('now', 904, 965, 202, 222), ('check', 903, 962, 228, 254), ('Friends', 391, 605, 346, 371)]
[('LIST_ITEM', 30, 482, 16, 232, [('Memoirs', 123, 398, 165, 220)]), ('LIST_ITEM', 500, 966, 16, 221, [('Comics', 660, 812, 165, 197)]), ('LIST_ITEM', 26, 487, 252, 556, [('gallery', 65, 452, 265, 488), ('Investing', 77, 450, 505, 536)]), ('LIST_ITEM', 512, 966, 254, 556, [('Spanish', 576, 897, 503, 536)]), ('LIST_ITEM', 19, 488, 591, 863, [('stop', 63, 454, 601, 827)]), ('LIST_ITEM', 509, 976, 589, 861, [('heart', 537, 939, 602, 823), ('TEXT', 539, 915, 843, 859)]), ('SKIP', 0, 167, 858, 935), ('PAGER_INDICATOR', 444, 547, 880, 910), ('NAVIGATION_BAR', 0, 998, 936, 999, [])]
[('TOOLBAR'
@matbee-eth
matbee-eth / idefics-8b-deepspeed.py
Last active April 26, 2024 03:22
Working version for a Deepspeed 3 fine-tune of Idefics-8b.
import torch
import safetensors
import random
import sys
import os
from transformers import HfArgumentParser, TrainingArguments, AutoProcessor, BitsAndBytesConfig, Idefics2ForConditionalGeneration, TrainingArguments, Trainer
from peft import prepare_model_for_kbit_training, LoraConfig, get_peft_model
from datasets import load_dataset, disable_caching
from dataclasses import dataclass, field
from typing import Optional
@matbee-eth
matbee-eth / machine.js
Last active November 6, 2019 15:28
Generated by XState Viz: https://xstate.js.org/viz
const initialState = {
id: 'toggle',
initial: 'idle',
context: {
msg: ''
},
states: {
idle: {
on: {
DONE_AVAILABLE: "granted",
@matbee-eth
matbee-eth / machine.js
Created November 5, 2019 20:23
Generated by XState Viz: https://xstate.js.org/viz
const grantedState = {
id: 'granted',
type: 'final'
}
const deniedState = {
id: 'denied',
type: 'final'
}
@matbee-eth
matbee-eth / gist:6676010
Created September 23, 2013 19:55
syslog
Sep 23 12:08:04 hp rsyslogd: [origin software="rsyslogd" swVersion="5.8.6" x-pid="650" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Sep 23 12:08:04 hp anacron[677]: Job `cron.daily' terminated (mailing output)
Sep 23 12:08:04 hp anacron[677]: Can't find sendmail at /usr/sbin/sendmail, not mailing output
Sep 23 12:08:04 hp anacron[677]: Normal exit (1 job run)
Sep 23 12:08:15 hp avahi-daemon[733]: Invalid response packet from host fe80::b55a:e7ab:6339:cf81.
Sep 23 12:09:55 hp avahi-daemon[733]: Invalid response packet from host fe80::b55a:e7ab:6339:cf81.
Sep 23 12:11:34 hp avahi-daemon[733]: Invalid response packet from host fe80::b55a:e7ab:6339:cf81.
Sep 23 12:12:56 hp kernel: [ 8330.612171] CPU0: Package power limit notification (total events = 2631)
Sep 23 12:12:56 hp kernel: [ 8330.612176] CPU2: Package power limit notification (total events = 2634)
Sep 23 12:12:56 hp kernel: [ 8330.612180] CPU3: Package power limit notification (total events = 2630)
@matbee-eth
matbee-eth / gist:6676003
Created September 23, 2013 19:54
dmesg
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.2.0-53-generic (buildd@allspice) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #81-Ubuntu SMP Thu Aug 22 21:01:03 UTC 2013 (Ubuntu 3.2.0-53.81-generic 3.2.50)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-53-generic root=UUID=3edc6101-c9cf-4801-9059-389e3464cc1c ro quiet splash
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009d400 (usable)
----
main.js
----
pageWorker = require("sdk/page-worker").Page({
contentURL: data.url("main-worker.html"),
contentScriptFile: [
data.url("js/jquery.min.js"),
data.url("main-worker.js")
]
});
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var enumy = wm.getEnumerator('navigator:browser');
var tabbrowser = enumy.getNext().gBrowser;
var browserTimeouts = {};
for (var index = 0; index <= tabbrowser.tabContainer.childNodes.length; index++) {
// Get the next tab
var currentTab = tabbrowser.tabContainer.childNodes[index];
if (!tabbrowser.browserid) {
In file included from ../../webrtc/base/iosfilesystem.mm:15:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:19:21: error: expected a type
- (id)copyWithZone:(nullable NSZone *)zone;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:25:28: error: expected a type
- (id)mutableCopyWithZone:(nullable NSZone *)zone;
^
/Applications/Xcode.app/Contents/Dev
@matbee-eth
matbee-eth / gist:3316065
Created August 10, 2012 17:46
aaaaaaaaaaaa
etseat