Skip to content

Instantly share code, notes, and snippets.

@veekaybee
veekaybee / normcore-llm.md
Last active July 3, 2024 22:14
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

@ninely
ninely / main.py
Last active June 27, 2024 07:56
Langchain with fastapi stream example
"""This is an example of how to use async langchain with fastapi and return a streaming response.
The latest version of Langchain has improved its compatibility with asynchronous FastAPI,
making it easier to implement streaming functionality in your applications.
"""
import asyncio
import os
from typing import AsyncIterable, Awaitable
import uvicorn
from dotenv import load_dotenv
@joeyslalom
joeyslalom / github-docker-artifact-registry.yaml
Created March 16, 2022 00:08
GitHub Action - docker build and push to Artifact Registry
# 1. Create service account
#. * Service Account Token Creator
#. * Artifact Registry Writer
# 2. Generate service account key
#. * In GitHub project -> Settings -> Secrets -> Actions -> New Repository Secret
#. Name: GCP_CREDENTIALS
#. Value: key.json contents
# 3. Create repo in artifact repository
#. * Name: $env.REPOSITORY below
#. * Region: $env.GAR_LOCATION below
@maclandrol
maclandrol / mdl_extended_parser.ipynb
Last active October 28, 2021 17:21
MDL extended parser (Ketcher flavour)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ashmore11
ashmore11 / gcp.tf
Last active March 2, 2023 20:29
Next Strapi Cloud Run (Terraform GCP)
provider "google" {
region = var.gcp_region
}
resource "random_id" "id" {
byte_length = 2
prefix = "${replace(lower(var.gcp_project_name), "/\\s+/", "-")}-"
}
resource "google_project" "project" {
@mcardozo
mcardozo / local.yml
Created January 5, 2021 19:14
Envío de emails con django, mailhog y celery
version: '3.8'
services:
mailhog:
image: mailhog/mailhog:v1.0.0
container_name: mailhog
expose:
- 1025
- 8025
ports:
@danilop
danilop / template.yaml
Last active February 29, 2024 12:50
Sample AWS SAM Template using Provisioned Concurrency with Application Auto Scaling
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Sample SAM Template using Application Auto Scaling + Provisioned Concurrency
Globals:
Function:
Timeout: 30
@arthurafarias
arthurafarias / README.md
Last active May 20, 2024 14:46
Encoding URI and URI Component in C++

Encode and Decode HTTP URIs and URI components in C++

What is a URI?

A Uniform Resource Identifier (URI) is a string of characters that unambiguously identifies a particular resource. To guarantee uniformity, all URIs follow a predefined set of syntax rules,[1] but also maintain extensibility through a separately defined hierarchical naming scheme (e.g. "http://").

Such identification enables interaction with representations of the resource over a network, typically the World Wide Web, using specific protocols. Schemes specifying a concrete syntax and associated protocols define each URI. The most common form of URI is the Uniform Resource Locator (URL), frequently referred to informally as a web address. More rarely seen in usage is the Uniform Resource Name (URN), which was designed to complement URLs by providing a mechanism for the identification of resources in particular namespaces.

The common parts of a URI are described below.

@lorne-luo
lorne-luo / README.md
Created November 17, 2017 03:49
Celery 4.1 Intergration with Django 1.11

Celery

Monitor celery by using celery -A freightquotes events

Start celery with beats celery -A freightquotes worker -B -E -l INFO --autoscale=2,1

Note:- 
    -B  beats - to execute schedule tasks
    -l  log-level (INFO/DEBUG)

-E --task-events

@uhho
uhho / pandas_s3_streaming.py
Last active December 2, 2022 18:57
Streaming pandas DataFrame to/from S3 with on-the-fly processing and GZIP compression
def s3_to_pandas(client, bucket, key, header=None):
# get key using boto3 client
obj = client.get_object(Bucket=bucket, Key=key)
gz = gzip.GzipFile(fileobj=obj['Body'])
# load stream directly to DF
return pd.read_csv(gz, header=header, dtype=str)
def s3_to_pandas_with_processing(client, bucket, key, header=None):