brew install git-lfs
git clone https://github.com/ml-explore/mlx-examples
cd mlx-examples/llms/mixtral
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1
cd Mixtral-8x7B-Instruct-v0.1
git lfs pull --include "consolidated.*.pt" # ~100GB
git lfs pull --include "tokenizer.model"
This file contains 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
[50, 100, 3].toSorted(Intl.Collator('en', { numeric: true }).compare) |
This file contains 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
import RSSParser from 'npm:rss-parser' | |
await Deno.mkdir('audio', { recursive: true }) | |
const feedURL = 'https://anchor.fm/s/1252b450/podcast/rss' | |
const feed = await new RSSParser().parseURL(feedURL) | |
for (const item of feed.items) { | |
const { url } = item.enclosure | |
console.log(url) |
This file contains 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
const links = document.querySelectorAll('a[download]') | |
if (links.length === 0) { | |
console.log("No downloadable files found") | |
return | |
} | |
const handle = await showSaveFilePicker({ | |
suggestedName: 'files.zip', | |
types: [{ |
This file contains 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
import { DOMParser, type Element, } from "https://deno.land/x/deno_dom@v0.1.43/deno-dom-wasm.ts"; | |
const parser = new DOMParser() | |
const fetchDOM = async (url: string) => { | |
const response = await fetch(url) | |
if (!response.ok) { | |
throw new Error('Response was not ok') | |
} | |
const html = await response.text() |
This file contains 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
import type { NextRequest } from 'next/server' | |
import { createParser } from 'eventsource-parser' | |
export const config = { | |
runtime: 'edge', | |
} | |
export default async function handler(req: NextRequest) { | |
const encoder = new TextEncoder() | |
const decoder = new TextDecoder() |
This file contains 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
# brew install awscli | |
# aws configure | |
aws s3 cp your-file.pdf s3://your-bucket/your-file.pdf | |
# https://pypi.org/project/amazon-textract-helper/ | |
# https://github.com/aws-samples/amazon-textract-textractor/tree/master/helper | |
# pip install amazon-textract-helper | |
amazon-textract --input-document s3://your-bucket/your-file.pdf --features TABLES --pretty-print TABLES --pretty-print-table-format=csv | |
# https://aws.amazon.com/blogs/machine-learning/automatically-extract-text-and-structured-data-from-documents-with-amazon-textract/ |
This file contains 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
[...document.querySelectorAll('div,main,body')].forEach(node => { | |
node.style.position = 'relative' | |
node.style.height = 'auto' | |
node.style.overflowY = 'visible' | |
}); | |
[...document.querySelectorAll('button')].forEach(node => { | |
node.remove() | |
}); |
This file contains 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
get_iplayer --pid m001d2h4 --subtitles --output "m001d2h4" | |
ffmpeg -i m001d2h4/Only_Connect_Series_18_-_07._Scrummagers_v_Crustaceans_m001d2h4_original.mp4 -vf "subtitles=m001d2h4/Only_Connect_Series_18_-_07._Scrummagers_v_Crustaceans_m001d2h4_original.srt" -ss 17:49 -t 5 -copyts output.mov |
This file contains 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
lineReader = () => { | |
let buffer = ""; | |
return new TransformStream({ | |
transform(chunk, controller) { | |
buffer += chunk; | |
const parts = buffer.split("\n"); | |
parts.slice(0, -1).forEach((part) => controller.enqueue(part)); | |
buffer = parts[parts.length - 1]; | |
}, |
NewerOlder