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
# This script is destined to be executed in a directory containing a series of files with a 'yyyymmdd' naming pattern | |
# e.g. "20240621_212441.wav". The script will parse the date in each filename and plot the number of files per year-month. | |
import os | |
import fnmatch | |
import matplotlib.pyplot as plt | |
# create empty list | |
list1=[] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# /// script | |
# requires-python = ">=3.13" | |
# dependencies = [ | |
# "groq", | |
# ] | |
# /// | |
from groq import Groq | |
import math | |
client = Groq() |
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 os | |
import math | |
import tkinter as tk | |
from tkinter import filedialog, messagebox | |
from typing import Dict, Optional | |
from groq import Groq | |
import logging | |
# Configure logging | |
logging.basicConfig( |
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
from groq import Groq | |
from datetime import timedelta | |
def format_time(seconds): | |
# Ensure the first segment starts at 00:00:00,000 | |
if float(seconds) < 0.001: | |
return "00:00:00,000" | |
time = str(timedelta(seconds=float(seconds))).replace('.', ',')[:-3] | |
return f"{time:0>12}" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Generated with Claude 3.5 Sonnet using vgel's r1.py script + the following prompt: | |
# "Can you modify this script to improve inference speed on a CPU-only PC?" | |
# It is possible to define the number of threads (= CPU cores) in the prompt | |
# Example run : python r1-cpu.py -t 32 "What is 1+1?" --threads 4 | |
import argparse | |
import random | |
import sys | |
from transformers import AutoModelForCausalLM, AutoTokenizer, DynamicCache |