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.
| 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") |
Yoav Goldberg, April 2023.
With the release of the ChatGPT model and followup large language models (LLMs), there was a lot of discussion of the importance of "RLHF training", that is, "reinforcement learning from human feedback". I was puzzled for a while as to why RL (Reinforcement Learning) is better than learning from demonstrations (a.k.a supervised learning) for training language models. Shouldn't learning from demonstrations (or, in language model terminology "instruction fine tuning", learning to immitate human written answers) be sufficient? I came up with a theoretical argument that was somewhat convincing. But I came to realize there is an additional argumment which not only supports the case of RL training, but also requires it, in particular for models like ChatGPT. This additional argument is spelled out in (the first half of) a talk by John Schulman from OpenAI. This post pretty much
info 9-3-23 Added 4bit LLaMA install instructions for cards as small as 6GB VRAM! (See "BONUS 4" at the bottom of the guide)
warning 9-3-23 Added Torrent for HFv2 Model Weights, required for ooga's webUI, Kobold, Tavern and 4bit (+4bit model)! Update ASAP!
danger 11-3-23 There's a new torrent version of the 4bit weights called "LLaMA-HFv2-4bit". The old "LLaMA-4bit" torrent may be fine. But if you have any issues with it, it's recommended to update to the new 4bit torrent or use the decapoda-research versions off of HuggingFace or produce your own 4bit weights. Newer Torrent Link or [Newer Magnet Link](magnet:?xt=urn:btih:36945b5958b907b3ab69e963ba0de1abdf48c16c&dn=LLaMA-HFv2-4bit&tr=http%3a%2f%2fbt1.archive.org%3a6969%2fannounce&tr=http%3a%2f%2fbt2.archive.org%3a696
| import gc | |
| import torch | |
| import gc | |
| from contextlib import ContextDecorator | |
| # pytorch method to find number of tensors in the graph | |
| def get_n_tensors(): | |
| tensors= [] | |
| for obj in gc.get_objects(): | |
| try: |
| """ | |
| stable diffusion dreaming | |
| creates hypnotic moving videos by smoothly walking randomly through the sample space | |
| example way to run this script: | |
| $ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry | |
| to stitch together the images, e.g.: | |
| $ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4 |
| import ws from 'k6/ws'; | |
| import { check } from 'k6'; | |
| export let options = { | |
| stages: [ | |
| { duration: '10s', target: 30 }, | |
| { duration: '30s', target: 30 }, | |
| { duration: '20s', target: 60 }, | |
| { duration: '30s', target: 60 }, | |
| { duration: '20s', target: 30 }, |
| #!/usr/bin/env python | |
| # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| # SPDX-License-Identifier: MIT-0 | |
| """ | |
| Deletes one or more Amazon Personalize dataset groups, including all of their associated resources: | |
| - Recommenders | |
| - Campaigns | |
| - Filters |
| def visualize_grid_cv_params(grid_cv): | |
| df = pd.DataFrame(grid_cv.cv_results_['params']) | |
| df['score'] = grid_cv.cv_results_['mean_test_score'] | |
| fig, axes = plt.subplots(1, len(grid_cv.param_grid), sharey=True, figsize=(15,4)) | |
| i = 0 | |
| for param in grid_cv.param_grid: | |
| data = df.groupby(param).mean()['score'].to_dict() | |
| param_values = list(data.keys()) |