Skip to content

Instantly share code, notes, and snippets.

View morganmcg1's full-sized avatar
💭
Trying to ML

Morgan McGuire morganmcg1

💭
Trying to ML
View GitHub Profile
@morganmcg1
morganmcg1 / ski_jacket.md
Created February 5, 2025 22:47
Ski jacket options

Got it! I'll look for women's ski jackets available in Ireland that are size small, warm, and within your budget of €150. I'll prioritize multi-color options and slightly longer designs that cover your bum. I'll get back to you soon with some recommendations.

Women’s Ski Jackets (Size Small) Under €150 in Ireland

Based on your criteria – size Small, budget up to €150, warmth, waterproofness & breathability, and a slightly longer cut (covers the bum) with a preference for multi-color – here are several highly-rated women’s ski jackets available for purchase in Ireland. Each option offers solid insulation and weather protection for skiing conditions, and each is available in size Small within your budget. Key details (material, insulation type, waterproof rating, features) and purchase links are included:

1. Mountain Warehouse “Altitude Extreme” RECCO Ski Jacket (Women’s)

  • Price & Availability: ~€130 (about £129) when not on sale ([Best women’s ski jackets 2024, tried
@morganmcg1
morganmcg1 / german_market.md
Created February 5, 2025 21:36
German language market analysis

Market Analysis: Adult German Learners in the EU and USA (2014–2024)

Market Size and Modality (Online vs. In-Person)

Overall Scale: The German language learning market is substantial. Globally, an estimated 15.4 million people were learning German as a foreign language in formal settings as of 2020 (15.4 million people are learning German – DW – 06/04/2020) Europe accounts for the majority: around 11.2 million German learners in Europe (formal education and courses) according to a 2020 survey (German as a foreign language: Growing numbers learning German in Africa and Asia - Federal Foreign Office ) The United States has a much smaller German-learning popula

Here's the data formatted as a markdown table:

Tool/Library Violation Handling Code Example - Initialization Code Example - Usage/Calling How the Guardrail is Used
AWS Bedrock Guardrails Exceptions, warnings, output modification bedrock_client.create_guardrail(name='my_guardrail', ...) response = client.invoke_model_with_guardrail(modelId='anthropic.claude-v2', guardrailId='my_guardrail_id', ...) Applied to both user inputs and model outputs during inference. Can be used to filter harmful content, block denied topics, redact PII, and filter words.
Nvidia Nemo Guardrails Reject input, alter input, execute actions, reject output, alter output config = RailsConfig.from_path("path/to/config") app = LLMRails(config) new_message = app.generate(messages=[{ "role": "user", "content": "Hello! What can you do for me?" }]) Uses Colang to define flows and a
@morganmcg1
morganmcg1 / guardrails_overview.md
Created January 29, 2025 07:55
guardrails overview
Tool/Library Guardrail Definition Guardrail Application Supported Types Violation Handling Open Source? Code Example
AWS Bedrock Guardrails Rules, constraints, policies Training, inference Safety, security, fairness, privacy Exceptions, warnings, output modification No bedrock_client.create_guardrail(name='my_guardrail', ...)
Nvidia Nemo Guardrails Colang flows Training, inference Input, dialog, output, retrieval, execution Reject input, alter input, execute actions, reject output, alter output Yes config = RailsConfig.from_path("path/to/config")
Guardrails Python library RAIL specifications Inference Semantic validation, type enforcement Corrective actions, re-prompting Yes guard = gd.Guard.from_rail_string(rail_str)
LangChain Integrates with Guardrails Python library Inference Content moderation, data privacy, b
@morganmcg1
morganmcg1 / ai_design_template.md
Created January 17, 2025 17:02
AI/Cursor Task Design Document, from this Cursor blog: https://skylarbpayne.com/posts/cursed-cursor#design-document

<TITLE>

Problem Statement

Requirements

Functional Requirements

import base64
from openai import OpenAI
import weave
import wave
client = OpenAI()
weave.init("audio-in-weave")
@weave.op()
@morganmcg1
morganmcg1 / gist:58e55e9f0abeb3f046ac851727a632ac
Created September 20, 2024 18:38
turn off wandb metadata logging
run = wandb.init(
settings={
"_disable_stats": True, # disable collecting system metrics
"_disable_meta": True, # disable collecting system metadata (including hardware info)
"console": "off", # disable capturing stdout/stderr
}
)
# From Unsloth Llama 3.1 fine-tuning notebook
from unsloth import FastLanguageModel
import torch
def print_gpu_stats():
gpu_stats = torch.cuda.get_device_properties(0)
start_gpu_memory = round(torch.cuda.max_memory_reserved() / 1024 / 1024 / 1024, 3)
max_memory = round(gpu_stats.total_memory / 1024 / 1024 / 1024, 3)
print(f"GPU = {gpu_stats.name}. Max memory = {max_memory} GB.")
celebrities = [
"Tom Cruise",
"Leonardo DiCaprio",
"Brad Pitt",
"Jennifer Lawrence",
"Scarlett Johansson",
"Johnny Depp",
"Meryl Streep",
"Robert De Niro",
"Tom Hanks",
#!/bin/bash
# Download the Miniforge installer
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
# Run the Miniforge installer
bash Miniforge3-Linux-x86_64.sh
# Install mamba in the base environment using conda
conda install mamba -n base -c conda-forge