Skip to content

Instantly share code, notes, and snippets.

View halr9000's full-sized avatar
👋
🤙

Hal Rottenberg halr9000

👋
🤙
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>360 Panorama Viewer</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<style>
body, html {
margin: 0;
@halr9000
halr9000 / README.md
Last active September 24, 2024 21:46
Ollama AI / LLM Utility Functions for PowerShell

Utility functions for use with Ollama in PowerShell

Want to run AI Large Language Models (LLM) locally? One great way is with Ollama, which can host many state of the art LLMs. Ollama is a command-line utility (CLI) that can be used to download and manage the model files (which are often multiple GB), perform the actual LLM inference, and provide a REST API to expose the LLMs to other applications on your system. Ollama is quick to install.

This repo contains functions for PowerShell. You can dot source this file to make the functions available in your current PowerShell session, or add it to your profile to make them available for every session. This was developed on Windows, but should work as-is on a Linux or [MacOS]

@halr9000
halr9000 / caption-image.py
Last active July 1, 2024 14:23
Python script to caption images using microsoft/florence-2 running locally using Pinokio and Gradio. Paper page: https://huggingface.co/papers/2311.06242. Model card: https://huggingface.co/microsoft/Florence-2-large. Gradio app: https://pinokio.computer/item?uri=https://github.com/pinokiofactory/florence2.
import argparse
import ast
from gradio_client import Client, handle_file
import json
import logging
logging.basicConfig(level=logging.ERROR, format='%(asctime)s - %(levelname)s - %(message)s')
# Define the task_prompts dictionary first
task_prompts = {
<#
.SYNOPSIS
Moves files to a destination folder based on their creation date.
.DESCRIPTION
This function moves files to a specified destination folder. The destination folder is structured by the file's creation date (yyyy-MM-dd). If the destination folder for a specific date does not exist, it will be created.
.PARAMETER Path
The file(s) to be moved. This parameter accepts pipeline input.
@halr9000
halr9000 / Mp4Utils.psm1
Last active October 30, 2023 01:51 — forked from gvoze32/ffmpeg GIF to MP4.MD
Mp4Utils: a PowerShell module for converting animated GIF to MP4 using ffmpeg
<#
.SYNOPSIS
Converts a GIF file to an MP4 file using ffmpeg.
.DESCRIPTION
The ConvertTo-Mp4 function takes a GIF file as input and converts it into an MP4 file.
It creates a directory named "mp4" to store the converted files.
If the MP4 file already exists, it will not perform the conversion.
# Flags used with ffmpeg
@halr9000
halr9000 / README.md
Last active February 22, 2024 00:25
Quick MusicGen setup for Windows

MusicGen for Windows

Overview

The following is a super quick mnod of facebookresearch/audiocraft to reliably install PyTorch with Cuda support on Windows, which the original repo does not document, and that slowed me down quite a bit. I wasted time so you don't have to! I am too lazy to create a proper fork and PR, but I'm sure someone else can do that if motivated.

I have included both virtualenv and conda methods.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@halr9000
halr9000 / Get-NvidiaGpu.ps1
Created December 24, 2022 02:52
Query NVIDIA-SMI for select properties and output them to the screen
try {
$output = nvidia-smi.exe -q -x
}
catch {
<#Do this if a terminating exception happens#>
throw "NVIDIA System Management Interface (nvidia-smi.exe) is not found. Learn more at https://developer.nvidia.com/nvidia-system-management-interface"
}
$xml = [xml]$output
$log = $xml.nvidia_smi_log
@halr9000
halr9000 / gen.ps1
Last active January 28, 2022 23:15
Quick helper script for VQGAN-CLIP
## Basic helper script for VQGAN-CLIP generation
## Assumes you have all dependencies setup as per https://github.com/nerdyrodent/VQGAN-CLIP
## Start from an Anaconda PowerShell shell, such as the shortcut in your start menu
## Be sure to setup the VQGAN Python environment first, but the script will activate it for you
## Place this script in the base directory containing generate.py
##
## Example 1: Run three jobs from an array
## > $prompts = "prompt1", "prompt2|3|4", "prompt5"
## > $prompts | % { .\gen.ps1 -Prompt $_ -Path $_.replace("|","-") }
##
<![LOG[CScanAgent::ScanByUpdates - Found UpdateClassification 0fa1201d-4330-4fa8-8ae9-b877473b6441 for Update:f2b6e975-cae9-493a-a17d-ca429e6738e5]LOG]!><time="10:40:29.580+300" date="11-12-2014" component="ScanAgent" context="" type="1" thread="12052" file="cscanagent.cpp:470">
<![LOG[Found CategoryID of :bfe5b177-a086-47a0-b102-097e4fa1f807 for Update:f61f6c4b-4598-4571-9663-9333a0906778]LOG]!><time="10:40:29.642+300" date="11-12-2014" component="ScanAgent" context="" type="1" thread="12052" file="cscanagent.cpp:453">
<![LOG[CScanAgent::ScanByUpdates - Found UpdateClassification 0fa1201d-4330-4fa8-8ae9-b877473b6441 for Update:f61f6c4b-4598-4571-9663-9333a0906778]LOG]!><time="10:40:29.643+300" date="11-12-2014" component="ScanAgent" context="" type="1" thread="12052" file="cscanagent.cpp:470">
<![LOG[Found CategoryID of :2ee2ad83-828c-4405-9479-544d767993fc for Update:f6bb2d17-0f0e-4a98-970b-7aaa85aae8ce]LOG]!><time="10:40:29.643+300" date="11-12-2014" component="ScanAgent" context="" type="1" thread="12052"