Skip to content

Instantly share code, notes, and snippets.

View markhern's full-sized avatar

Mark Hernandez markhern

  • Virginia, U.S.A.
View GitHub Profile
@markhern
markhern / Llama_inference_README.md
Last active February 22, 2025 12:12 — forked from kevmo314/README.md
Llama inference in 150 lines.

It turns out if you're just doing inference, Llama can be written very concisely. This implementation includes paged attention. Speculative decoding can also be added for another speed boost however it's quite verbose and was left out to keep the implementation cleaner.

Download the Llama files and place them in a directory ./Llama3.2-3B (or whatever flavor of Llama you want).

Your directory structure should look like:

./Llama3.2-3B/consolidated.00.pth
@markhern
markhern / upload.go
Created May 19, 2023 19:11 — forked from mrkagelui/upload.go
stream data from DB to upload
package main
import (
"context"
"encoding/csv"
"errors"
"fmt"
"io"
"log"
"os"
func main() {
s := time.Now()
args := os.Args[1:]
if len(args) != 6 { // for format LogExtractor.exe -f "From Time" -t "To Time" -i "Log file directory location"
fmt.Println("Please give proper command line arguments")
return
}
startTimeArg := args[1]
finishTimeArg := args[3]
@markhern
markhern / Program.cs
Created July 30, 2020 13:16 — forked from NMillard/Program.cs
If-Else vs Dynamic Type Discovery
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.Json;
namespace DesignPatterns.DynamicStrategy {
class Program {
static void Main(string[] args) {
/*
@markhern
markhern / setup.py
Last active July 16, 2020 20:53 — forked from mattvh/setup.py
Writing a GUI Application with Python and Py2App
from setuptools import setup #Writing a GUI Application with Python and Py2App
APP = ['subreddit.py']
DATA_FILES = []
OPTIONS = {
'argv_emulation': True,
'site_packages': True,
#'iconfile': 'appicon.icns',
'packages': ['wx', 'requests'],
'plist': {