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.
![Screenshot 2023-12-18 at 10 40 27 PM](https://private-user-images.githubusercontent.com/3837836/291468646-4c30ad72-76ee-4939-a5fb-16b570d38cf2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE2NjYwNTYsIm5iZiI6MTcyMTY2NTc1NiwicGF0aCI6Ii8zODM3ODM2LzI5MTQ2ODY0Ni00YzMwYWQ3Mi03NmVlLTQ5MzktYTVmYi0xNmI1NzBkMzhjZjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjJUMTYyOTE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDUxMTFmMWIwMTcxYjM2ZWQ5OGIxMjNjMDQ1MmFkZjNkNmE3YjI0MDUxYjc1NjkwOGU1NzMxMzM2NjAwNDUyNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.OEmVVHRkcbqLvFJEofgZvIIihQ5-MMIbh8GyUOoOXSw)
from typing import List, Dict, Literal, Union | |
from transformers import AutoTokenizer | |
class MistralAICtx: | |
def __init__(self, model_name: str): | |
assert "mistral" in model_name, "MistralCtx only available for Mistral models" | |
self.tokenizer = AutoTokenizer.from_pretrained( | |
"mistralai/Mistral-7B-Instruct-v0.2") |
import torch | |
from unsloth import FastLlamaModel | |
from transformers import TrainingArguments | |
from datasets import load_dataset | |
from trl import DPOTrainer | |
model_name = "teknium/OpenHermes-2.5-Mistral-7B" | |
model_name = "./OpenHermes-2.5-Mistral-7B" | |
new_model = "NeuralHermes-2.5-Mistral-7B" |
import torch | |
from typing import Optional | |
from flash_attn import flash_attn_func, flash_attn_qkvpacked_func | |
from diffusers.models.attention import Attention | |
class FlashAttnProcessor: | |
r""" | |
Processor for implementing memory efficient attention using flash_attn. | |
""" |
import torch | |
from pipe import StableDiffusionXLPipelineNoWatermark | |
from pipei2i import StableDiffusionXLImg2ImgPipelineNoWatermark | |
from diffusers import DiffusionPipeline | |
from PIL import Image | |
import os | |
import gc | |
import pandas as pd | |
import random, sys |
import os | |
import sys | |
from typing import List | |
import fire | |
import torch | |
import transformers | |
from datasets import load_dataset, DatasetDict | |
from transformers import Seq2SeqTrainer, TrainerCallback, TrainingArguments, TrainerState, TrainerControl | |
from transformers.trainer_utils import PREFIX_CHECKPOINT_DIR |
this is a rough draft and may be updated with more examples
GitHub was kind enough to grant me swift access to the Copilot test phase despite me @'ing them several hundred times about ICE. I would like to examine it not in terms of productivity, but security. How risky is it to allow an AI to write some or all of your code?
Ultimately, a human being must take responsibility for every line of code that is committed. AI should not be used for "responsibility washing." However, Copilot is a tool, and workers need their tools to be reliable. A carpenter doesn't have to
add_executable(infervideo infervideo.cpp) | |
target_link_libraries(infervideo PRIVATE retinanet ${OpenCV_LIBS} cuda ${CUDA_LIBRARIES}) |
# The script illustartes stunning difference on my machine with processing of signal with multiprocessing and joblib. | |
# The slowness of multiprocessing is likely caused by oversubscription | |
import time | |
import numpy as np | |
import librosa | |
from joblib import Parallel, delayed | |
from functools import partial | |
from multiprocessing import Pool |