| // 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
| // You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
| (() => { | |
| const SHOW_SIDES = false; // color sides of DOM nodes? | |
| const COLOR_SURFACE = true; // color tops of DOM nodes? | |
| const COLOR_RANDOM = false; // randomise color? | |
| const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
| const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
| const THICKNESS = 20; // thickness of layers | |
| const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
| { | |
| "workbench.colorTheme": "Aura Dark", | |
| "workbench.iconTheme": "material-icon-theme", | |
| "editor.fontFamily": "'Geist Mono', Menlo, Monaco, 'Courier New', monospace", | |
| "apc.listRow": { | |
| "height": 24, | |
| "fontSize": 11 | |
| }, | |
| "window.titleBarStyle": "native", | |
| "apc.font.family": "Geist Mono", |
| # Clone llama.cpp | |
| git clone https://github.com/ggerganov/llama.cpp.git | |
| cd llama.cpp | |
| # Build it | |
| make clean | |
| LLAMA_METAL=1 make | |
| # Download model | |
| export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin |
| // See the comments at the end for a model that does much better than e5-large-v2 while being a third of the size. | |
| let { pipeline } = await import('https://cdn.jsdelivr.net/npm/@xenova/[email protected]'); | |
| let extractor = await pipeline('feature-extraction', 'Xenova/e5-large-v2'); | |
| // Note: If you're just comparing "passages" with one another, then just prepend "passage: " to all texts. Only use "query: " if the text is a short "search query" like in the above example. | |
| let passage1 = await extractor(`passage: The Shawshank Redemption is a true masterpiece of cinema.`, { pooling: 'mean', normalize: true }); | |
| let passage2 = await extractor(`passage: The film should not be exposed to sunlight when removing it from the wrapper. Otherwise your movie will come out bad.`, { pooling: 'mean', normalize: true }); | |
| let query = await extractor(`query: movie review`, { pooling: 'mean', normalize: true }); |
| import torch | |
| #USE AT YOUR OWN RISK | |
| #local path to runwayML SD 1.5 checkpoint (https://huggingface.co/runwayml/stable-diffusion-v1-5) | |
| ckpt_15 = "./v1-5-pruned-emaonly.ckpt" | |
| #local path to StabilityAI finetuned autoencoder (https://huggingface.co/stabilityai/sd-vae-ft-mse) | |
| ckpt_vae = "./vae-ft-mse-840000-ema-pruned.ckpt" |
| # This is a sample Python script. | |
| # Press ⌃R to execute it or replace it with your code. | |
| # Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings. | |
| import aiohttp | |
| event_loop = None | |
| import asyncio | |
| from pprint import pprint |
| // add script to a button inside Cryptovoxels to return a response | |
| feature.on('click',e=>{ | |
| // Use GraphQL endpoint to pull data and make model that takes x,y Decentraland coordinates and returns prediction based on the latest 10 sales! | |
| fetch('https://api.thegraph.com/subgraphs/name/decentraland/marketplace', { | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/json', |
| query findSecondarySales($address: String = "tz1c2iwyckUCcicx2qxqtwLEartYFEHg1pvB") { | |
| hic_et_nunc_swap(where: {status: {_in: [1]}, token: {swaps: {trades: {buyer: {address: {_eq: $address}}}}}}, order_by: {price: desc}) { | |
| price | |
| status | |
| token { | |
| title | |
| mime | |
| description | |
| id | |
| artifact_uri |