Skip to content

Instantly share code, notes, and snippets.

View fpaupier's full-sized avatar
🎯
Focus

Frαnçois fpaupier

🎯
Focus
View GitHub Profile
@imartinez
imartinez / fastapi_streaming_local_llama2.py
Created September 26, 2023 17:21
FastAPI streaming local Llama 2 GGUF LLM using LLamaIndex
import uvicorn
from contextlib import asynccontextmanager
from fastapi import FastAPI
from fastapi.responses import StreamingResponse
from typing import AsyncGenerator
from llama_index.llms import LlamaCPP
from llama_index.llms.llama_utils import messages_to_prompt, completion_to_prompt
llms = {}
@denguir
denguir / cuda_install.md
Last active October 19, 2025 11:37
Installation procedure for CUDA / cuDNN / TensorRT

How to install CUDA / cuDNN / TensorRT on Ubuntu

Install NVIDIA drivers

Update & upgrade

sudo apt update && sudo apt upgrade

Remove previous NVIDIA installation

@ninely
ninely / main.py
Last active September 15, 2025 10:10
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
@rain-1
rain-1 / LLM.md
Last active October 20, 2025 07:02
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@liviaerxin
liviaerxin / README.md
Last active October 23, 2025 12:29
FastAPI and Uvicorn Logging #python #fastapi #uvicorn #logging

FastAPI and Uvicorn Logging

When running FastAPI app, all the logs in console are from Uvicorn and they do not have timestamp and other useful information. As Uvicorn applies python logging module, we can override Uvicorn logging formatter by applying a new logging configuration.

Meanwhile, it's able to unify the your endpoints logging with the Uvicorn logging by configuring all of them in the config file log_conf.yaml.

Before overriding:

uvicorn main:app --reload
@gregveres
gregveres / font-size.ts
Created May 3, 2022 22:34
font-size for tiptap 2
import { Extension } from "@tiptap/core";
import "@tiptap/extension-text-style";
export type FontSizeOptions = {
types: string[];
};
declare module "@tiptap/core" {
interface Commands<ReturnType> {
fontSize: {

Manipulation (positive ou négative): émotionnelle, de la perception de soi et de la perception de la société

Emotions

  1. Experimental evidence of massive-scale emotional contagion through social networks, (2014).
    Papier très connu de Facebook, l'objectif est de voir à quel point la contagion émotionelle fonctionne sur FB. Les chercheurs font apparaitre plus ou moins de contenus postifs/négatifs dans le NewsFeed.
    "When positive expressions were reduced, people produced fewer positive posts and more negative posts; when negative expressions were reduced, the opposite pattern occurred. These results indicate that emotions expressed by others on Facebook influence our own emotions, constituting experimental evidence for massive-scale contagion via social networks"
@bittner
bittner / keyboard-keys.md
Created February 28, 2019 22:50
Keyboard keys markup in MarkDown

Ctrl + Alt + Space

@rohshall
rohshall / convert.py
Last active February 28, 2024 15:25 — forked from EsotericAlgorithm/convert.py
A script to process azw3, epub, and mobi into text files using calibre ebook-convert
import os
import shlex
import subprocess
sink = open('/dev/null', 'w')
def convert_book(input, output):
subprocess.call("ebook-convert" + " " + input + " " + output, shell=True, stdout=sink, stderr=sink)
@steven2358
steven2358 / ffmpeg.md
Last active October 27, 2025 18:19
FFmpeg cheat sheet