This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| n_train = 1024 # 5600 | |
| n_test = 2048 # 380000 | |
| n_examples = 2 # this is PER CLASS | |
| batch_size = 4 | |
| model_id = "meta-llama/Llama-3.2-1B-Instruct" | |
| from os.path import exists | |
| from sys import stderr | |
| def load_csv(filename: str) -> list[tuple[str, str]]: | |
| if not exists(filename): | |
| print(f"{filename} not found!", file=stderr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Download the Yelp Review Polarity CSV and unzip alongside this code under `yelp_review_polarity_csv`. | |
| # Read more at https://joecooper.me/blog/ragshot/ | |
| # Config | |
| n_train = 5600 # how much of the train set to gather into the table? | |
| n_test = 38000 # how much of the test set to run? | |
| batch_size = 16 # adjust according to your RAM | |
| # Reszta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Download the Yelp Review Polarity CSV and unzip alongside this code under `yelp_review_polarity_csv`. | |
| # Read more at https://joecooper.me/blog/ragshot/ | |
| # Config | |
| n_train = 5600 # How much labeled data to use? | |
| n_test = 38000 # How many test samples to run? | |
| n_examples = 2 # How many examples per inference? | |
| batch_size = 8 # Set according to your RAM | |
| # Reszta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # This "semantic grep" matches lines by ChatGPT | |
| # Provide an OpenAI key via environment variable | |
| # Provide a question in plain language as first parameter | |
| # Pipe from cat or whatever | |
| # Optional; provide examples and counter-examples | |
| # cat input.txt | sgrep.py "Is this an animal name?" --example "fox" --counter-example "Rasputin" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (define (leibnizFormulaForPi steps) | |
| (define (stage step) (* (/ 1 (+ 1 (* step 2))) (if (= (modulo step 2) 1) -1 1))) | |
| (define (iterate thusFar step steps) | |
| (if (< step steps) | |
| (iterate (+ thusFar (stage step)) (+ step 1) steps) | |
| (+ thusFar (stage step)) | |
| ) | |
| ) | |
| (* 4 (iterate 0 0 steps)) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| [RequireComponent(typeof(AudioSource))] | |
| public class NoiseCancellationExperiment : MonoBehaviour { | |
| public enum Mode { | |
| Direct, NegateOne, NegateBoth | |
| } | |
| public int samplesPerSecond = 44100; | |
| public double[] tones = new [] { 350.0, 440.0 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "Noble Muffins/UI Additive" { | |
| Properties { | |
| _MainTex ("Texture", 2D) = "white" {} | |
| _StencilComp ("Stencil Comparison", Float) = 8 | |
| _Stencil ("Stencil ID", Float) = 0 | |
| _StencilOp ("Stencil Operation", Float) = 0 | |
| _StencilWriteMask ("Stencil Write Mask", Float) = 255 | |
| _StencilReadMask ("Stencil Read Mask", Float) = 255 | |
| _ColorMask ("Color Mask", Float) = 15 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Copyright 2016 Joe Cooper | |
| //Find the most up to date version on Gist: https://gist.github.com/JoeCooper/032b1337b13bd9fb0eb8c0cae35c5d67 | |
| using System; | |
| using System.Collections.Generic; | |
| namespace NobleMuffins | |
| { | |
| public class SetMapper<TSubject, TRepresentation>: SetMapper<TSubject, TSubject, TRepresentation> | |
| { |