sudo apt update && sudo apt upgrade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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é
- 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"
Ctrl + Alt + Space
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main() { | |
# Use colors, but only if connected to a terminal, and that terminal | |
# supports them. | |
if which tput >/dev/null 2>&1; then | |
ncolors=$(tput colors) | |
fi | |
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then | |
RED="$(tput setaf 1)" | |
GREEN="$(tput setaf 2)" | |
YELLOW="$(tput setaf 3)" |
NewerOlder