Skip to content

Instantly share code, notes, and snippets.

View phydev's full-sized avatar
:electron:
A minha história é um denso algoritmo.

Maurício Moreira-Soares phydev

:electron:
A minha história é um denso algoritmo.
View GitHub Profile
@svpino
svpino / llama2.py
Last active January 25, 2024 13:12
Running a fine-tuned Llama 2 model
import torch
import peft
import transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
from huggingface_hub.hf_api import HfFolder
ACCESS_TOKEN = "ENTER YOUR HUGGINGFACE ACCESS TOKEN HERE"
HfFolder.save_token(ACCESS_TOKEN)
@JoaoLages
JoaoLages / RLHF.md
Last active June 24, 2024 09:45
Reinforcement Learning from Human Feedback (RLHF) - a simplified explanation

Maybe you've heard about this technique but you haven't completely understood it, especially the PPO part. This explanation might help.

We will focus on text-to-text language models 📝, such as GPT-3, BLOOM, and T5. Models like BERT, which are encoder-only, are not addressed.

Reinforcement Learning from Human Feedback (RLHF) has been successfully applied in ChatGPT, hence its major increase in popularity. 📈

RLHF is especially useful in two scenarios 🌟:

  • You can’t create a good loss function
    • Example: how do you calculate a metric to measure if the model’s output was funny?
  • You want to train with production data, but you can’t easily label your production data
@LegrandNico
LegrandNico / CornerHist.ipynb
Created May 12, 2020 15:26
Scatterplot of repeated measures with histogram of differences
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yunpengn
yunpengn / README.md
Last active May 20, 2024 06:57
A step-by-step guide to install PostgreSQL on Ubuntu without sudo privilege

Install PostgreSQL on Ubuntu without sudo

Being the most advanced open-source relational database, many of us need to install PostgreSQL for some purposes. However, sometimes you may not have sudo privilege on an Ubuntu server. Then, how should you install PostgreSQL in this case?

Compile from source!

Next, we will show a step-by-step guide on how to install PostgreSQL on Ubuntu by compiling it from source.

PostgreSQL Compilation & Installation

@jenniferthompson
jenniferthompson / genericized_dd.Rmd
Last active November 11, 2023 23:56
Example structure for data dictionary + code used for derivation using RMarkdown. Creates three data tables and documents general + field-specific info.
---
title: "Example Data Dictionary"
author: "Jennifer Thompson"
date: "11/1/2018"
output:
html_document:
theme: yeti
code_folding: hide
---
@n-s-k
n-s-k / OOP_F2003_Part_2.md
Last active May 10, 2024 13:46
Object-Oriented Programming in Fortran 2003 Part 2: Data Polymorphism

Object-Oriented Programming in Fortran 2003 Part 2: Data Polymorphism

Original article by Mark Leair, PGI Compiler Engineer

Note: This article was revised in March 2015 and again in January 2016 to bring it up-to-date with the production software release and to correct errors in the examples.

This is Part 2 of a series of articles:

@Luthaf
Luthaf / Foo.cpp
Last active September 18, 2023 22:40
Calling C++ from Fortran
#include "Foo.hpp"
#include <iostream>
using namespace std;
Foo::Foo(int _a, int _b): a(_a), b(_b){
cout << "C++ side, constructor" << endl;
}
Foo::~Foo(){