Skip to content

Instantly share code, notes, and snippets.

@mtanco
mtanco / mlops_throughput.sh
Last active January 23, 2025 00:06
This code uses a running deployment to test throughput in a range of situations. Replicas are changed elsewhere with MLOps UI or API
#!/bin/bash
# Define the base command and endpoint
URL="https://model.dev.h2o.ai/496095fa-d429-4da0-b7d1-8239fe644410/model/score"
BASE_CMD="ab -T \"application/json\" "
TEST_SIZE=500
# Initialize the results table
echo "| Test Size | Batch Size | Replicas | Concurrency | r/s |"
echo "|-----------|------------|----------|-------------|-----|"
# Define test scenarios
@mtanco
mtanco / hello_world.py
Created February 3, 2025 17:48
A classic 'Hello, World!' program in Python. This simple program demonstrates the basic syntax of Python and serves as a traditional first program for learning Python programming. It showcases Python's straightforward and readable syntax by using the print() function to output text to the console.
print("Hello, World!")
@mtanco
mtanco / h2ogpte_banking_rag_demo.py
Created February 3, 2025 18:08
h2oGPTe Banking RAG Demo - Intelligent Document Processing for Financial Services This demo showcases how to leverage h2oGPTe's powerful RAG capabilities for banking and financial services use cases. It demonstrates: - Automated knowledge base creation from banking documentation - Intelligent Q&A using RAG - Best practices for financial documen…
"""
h2oGPTe Banking RAG Demo
Demonstrates using h2oGPTe for intelligent document processing in financial services
This demo shows how to:
1. Crawl relevant banking documentation
2. Create a knowledge base
3. Perform intelligent Q&A using RAG
"""
@mtanco
mtanco / python_threading_example.py
Created February 3, 2025 18:57
Python Multi-threading Examples: Demonstrates three common patterns - Basic Thread Synchronization, Queue-based Communication, and Modern Thread Pools
"""
Python Multi-threading Examples
-----------------------------
This example demonstrates three common patterns for multi-threading in Python:
1. Basic thread synchronization using Lock
2. Thread communication using Queue
3. Modern thread pools using concurrent.futures
Key concepts demonstrated:
- Thread creation and management