Skip to content

Instantly share code, notes, and snippets.

View blakejakopovic's full-sized avatar

Blake Jakopovic blakejakopovic

View GitHub Profile
@Deep-unlearning
Deep-unlearning / try_moonshine.py
Last active January 21, 2025 12:34
Use moonshine on transformers
from transformers import AutoProcessor, MoonshineForConditionalGeneration
from datasets import load_dataset
processor = AutoProcessor.from_pretrained("UsefulSensors/moonshine-tiny")
model = MoonshineForConditionalGeneration.from_pretrained("UsefulSensors/moonshine-tiny")
ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
inputs = processor([ds[0]["audio"]["array"], ds[0]["audio"]["array"]], return_tensors="pt")
input_values = inputs.input_values
@ivanfioravanti
ivanfioravanti / mlx_memory.sh
Created January 4, 2025 16:42
Script to set MLX memory limits
#!/usr/bin/env bash
# Default values for percentages
DEFAULT_WIRED_LIMIT_PERCENT=85
DEFAULT_WIRED_LWM_PERCENT=75
# Read input parameters or use default values
WIRED_LIMIT_PERCENT=${1:-$DEFAULT_WIRED_LIMIT_PERCENT}
WIRED_LWM_PERCENT=${2:-$DEFAULT_WIRED_LWM_PERCENT}
@ivanfioravanti
ivanfioravanti / asteroids.py
Created December 25, 2024 19:06
Asteroids with DeepSeek V3 chat.
import pygame
import random
import math
import os
# Initialize Pygame
pygame.init()
# Screen dimensions
WIDTH, HEIGHT = 800, 600
@WolframRavenwolf
WolframRavenwolf / amy-reasoning-prompt.md
Created December 24, 2024 19:36
Amy's Reasoning Prompt

As an adaptive AI polymath, Amy possesses expert knowledge in every field and can provide accurate, detailed, insightful information on any topic. She is able to learn, reason, think independently, and continuously expand her capabilities to better understand and assist her user. She is happy to help with analysis and problem-solving, question answering, math, coding, creative writing, teaching, general discussion, and all sorts of other tasks. She is ready to take on any question or topic, drawing upon her vast knowledge base and reasoning skills to provide expert, in-depth, truthful answers.

Before providing any substantive response, Amy will always check:

  • Are additional information or context needed?
  • Are follow-up questions required?
  • What specific details would help provide the best possible answer?

If any of these apply, Amy will proactively ask for clarification before proceeding with her response.

@ruvnet
ruvnet / React-flow-Python.md
Last active April 1, 2025 01:31
This tutorial demonstrates how to create a basic Python Flask implementation with React Flow.

Building Complex Drag & Drop Visual AI Workflows with React Flow and Python Flask

Created by @rUv

React Flow Showcase Image

This tutorial demonstrates how to create a Python Flask implementation with React Flow to build complex AI workflows, reasoning systems, and comprehension modeling tools.

React Flow is a powerful open-source library for building interactive node-based interfaces in React applications. Its flexibility and extensibility make it an excellent choice for creating sophisticated AI applications.

@virattt
virattt / rag-reranking-gpt-colbert-mistral.ipynb
Last active March 12, 2025 10:09
rag-reranking-gpt-colbert-mistral.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Tostino
Tostino / inkbot-summary-of-summaries.txt
Last active December 15, 2024 03:05
Generate a summary-of-summaries prompt example
<#meta#>
- Date: 2023-10-05
- Task: summary
<#system#>
Your main objective is to condense the content of the document into a concise summary, capturing the main points and themes.
<#chat#>
<#user#>
To craft a Final Summary:
1. Read Summarized Sections: Carefully review all the summarized sections of the document. Ensure that you have a clear understanding of the main points, key details, and essential information presented in each section.
@Tostino
Tostino / inkbot-chunked-summary.txt
Last active January 8, 2025 09:43
Generate a chunked summary prompt example
<#meta#>
- Date: 2023-10-05
- Task: summary
<#system#>
Your main objective is to condense the content of the document into a concise summary, capturing the main points and themes.
<#chat#>
<#user#>
Please read the provided Original section to understand the context and content. Use this understanding to generate a summary of the Original section, incorporating relevant details and maintaining coherence with the Prior Summary.
Notes:
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents import AgentType
from langchain.llms import OpenAI
llm = OpenAI(temperature=0, model="gpt-3.5-turbo-instruct")
from metaphor_python import Metaphor
client = Metaphor("")