Skip to content

Instantly share code, notes, and snippets.

View gilinachum's full-sized avatar

Gili Nachum gilinachum

View GitHub Profile
@gilinachum
gilinachum / llm.hebrew.classification.results.20230717.csv
Last active July 17, 2023 13:17
llm hebrew. lassification results 2023/07/17
LLM Accuracy Cost 1MT/Input Correct answers Total answers
anthropic.claude-v1 75.41% $11 46 61
anthropic.claude-instant-v1 70.49% $1.6 43 61
text-davinci-003 62.3% $1.5 38 61
gpt-3.5-turbo 50.82% $30 31 61
GPT-4 not yet tested $30 - 61
anthropic.claude-v2 not yet tested $11.02 - 61
@gilinachum
gilinachum / folder_splitter.py
Created December 29, 2018 16:17
splits a folder with millions of files to mini folders by creating hardlinks
#!python3
import os
import traceback
import datetime
source_base_path = '/tmp/sourcedir'
target_base_path = '/tmp/targetdir/'
current_mini_folder = 0
files_counter = 0
@gilinachum
gilinachum / UUIDToHashcodeUniquenessTestMain
Last active January 12, 2016 08:52
Empirically tests degree of uniqueness when converting UUIDs to hashcode values
package collisions.test;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
public class UUIDToHashcodeUniquenessTestMain {
private final static int num_of_users = 1000 * 1000;
private final static int num_of_stacks = 50;
@gilinachum
gilinachum / FieldsIndexingMemTest.java
Created June 14, 2015 12:03
Cost of fields in Lucene index
import java.io.File;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.util.Random;
import java.util.UUID;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.WhitespaceAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
@gilinachum
gilinachum / MobileLikeSmallHeapDuringTestsEnforce
Last active December 27, 2015 02:49
Max heap enforcer. Makes sure your unit tests heap size, on the PC, is not larger than the heap size of the Android device your developing for (24m-64m). Otherwise your code will rock on the PC, but get an OOME on the device.
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class MobileLikeSmallHeapDuringTestsEnforce {
public static final long MB = 1024 * 1024;
public static final long ANDROID_TYPICAL_MAX_HEAP_MB = 24;
public static final String XMX_ARGUMENT = "-Xmx" + ANDROID_TYPICAL_MAX_HEAP_MB + "m";
@Test
public void assertHeapIsMobileLikeSmall() {