Skip to content

Instantly share code, notes, and snippets.

@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active January 29, 2025 22:28
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@veekaybee
veekaybee / normcore-llm.md
Last active January 29, 2025 22:26
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@axelknock
axelknock / main.py
Last active January 29, 2025 22:21
Example of Datastar with FastHTML, ported from a FastAPI example
import asyncio
import json
from datetime import datetime
from fasthtml.common import *
from fasthtml.starlette import StreamingResponse
from fasthtml.core import to_xml
from datastar_py.sse import SSE_HEADERS, ServerSentEventGenerator
@gyopiazza
gyopiazza / schema.ts
Last active January 29, 2025 21:48
Multi-tenant with Drizzle ORM (multiple sqlite databases) - PoC
import { integer, sqliteTableCreator, text } from 'drizzle-orm/sqlite-core'
const sqliteTable = (tenant?: string) =>
sqliteTableCreator(name => (tenant ? `${tenant}_${name}` : name))
export const users = sqliteTable()('users', {
id: integer('id', { mode: 'number' }).primaryKey({ autoIncrement: true }),
name: text('name'),
})
/**
* Configuration object for API settings.
* Contains key constants used throughout the extraction process.
*/
const API_CONFIG = {
key: "...", // Your Firecrawl API key
baseUrl: 'https://api.firecrawl.dev/v1', // Base URL for Firecrawl API endpoints
timeout: 30, // Timeout for HTTP requests in seconds
maxAttempts: 10, // Maximum number of attempts to poll for job completion
initialDelay: 1000 // Initial delay (in ms) before polling for job status
@ruvnet
ruvnet / *DeepSeek-uncensored.md
Last active January 29, 2025 21:19
Deploying and Fine-Tuning an Uncensored DeepSeek R1 Distill Model on Google Cloud

DeepSeek R1 Distill: Complete Tutorial for Deployment & Fine-Tuning

This guide shows how to deploy an uncensored DeepSeek R1 Distill model to Google Cloud Run with GPU support and how to perform a basic, functional fine-tuning process. The tutorial is split into:

  1. Environment Setup
  2. FastAPI Inference Server
  3. Docker Configuration
  4. Google Cloud Run Deployment
  5. Fine-Tuning Pipeline (Cold Start, Reasoning RL, Data Collection, Final RL Phase)
@toshimaru
toshimaru / check-server-process-using-jemalloc.rb
Last active January 29, 2025 21:00
Enable jemalloc for alpine.
# Check server process is using jemalloc
# ref. [Japanese] https://tech.studyplus.co.jp/entry/2019/09/09/094140
class AppController < ActionController::Base
def show
r = `strings /proc/#{Process.pid}/maps | grep jemalloc`
render plain: "<h1>#{ENV['LD_PRELOAD'].presence || 'empty'}</h1><pre>#{r}</pre>"
end
end
@roshanmirajkar
roshanmirajkar / TwitterFollowingCSV.js
Created December 31, 2023 02:21
Twitter Following List Exporter
/*
Collect and export a list of Twitter usernames you're following, along with follow-back status, to a CSV file every 80 seconds. Done client-side using Javascript running in the Console window of the web browser.
Instructions:
1) Modify the 'LANGUAGE' variable to match your Twitter interface language.
2) Customize 'SKIP_USERS' with usernames you do not wish to include in the CSV.
3) 'PRINT_FOLLOW_INFORMATION' determines whether follow-back status is included.
4) 'SKIP_FOLLOWERS' and 'SKIP_NON_FOLLOWERS' settings filter out respective user groups.
5) 'MS_PER_CYCLE' controls the frequency of data collection cycles.
6) Load the Twitter page showing users you're following, open the console (F12), paste this code, and run it.
@Paulladium46
Paulladium46 / NTLite-Image-Config-Notes.md
Last active January 29, 2025 20:47
NTLite Windows 11 Image Creation Notes

NTLite Image Configuration Notes - Windows 11 - 23H2

  • April 2024
    • updated with latest NTLite (2024.4.9880) and Windows 11 23H2 (Update 1) ISO (Feb 2024)
    • Negate default Admin user password expiration
    • apply latest security updates
    • So far, no luck removing the onedrive backup nag message without completely disabling Onedrive notifications
  • Nov 2023
  • updated with latest NTLite and Windows 11 23H2 ISO (Oct 2023)