Skip to content

Instantly share code, notes, and snippets.

@mlabonne
mlabonne / finetune_llama2.py
Last active April 18, 2024 07:00
Easy Llama 2 fine-tuning script (📝 Article: https://tinyurl.com/finetunellama2)
# Based on younesbelkada/finetune_llama_v2.py
# Install the following libraries:
# pip install accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers==4.31.0 trl==0.4.7 scipy
from dataclasses import dataclass, field
from typing import Optional
import torch
from datasets import load_dataset
from transformers import (
@rkjha
rkjha / nginx-config-rails4-with-puma-ssl-version.conf
Last active November 2, 2023 11:57
Nginx config for rails 4 application using puma [ssl and non-ssl version]
upstream myapp_puma {
server unix:/tmp/myapp_puma.sock fail_timeout=0;
}
# for redirecting to https version of the site
server {
listen 80;
rewrite ^(.*) https://$host$1 permanent;
}
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@karmi
karmi / geo_distance_filter_in_tire.rb
Created June 28, 2011 14:13
Geo Distance Filter Support in Tire/ElasticSearch
require 'tire'
require 'active_support/core_ext/numeric'
require 'active_support/core_ext/time/zones'
# Tire.configure { logger STDERR, level: 'debug' }
class Time; DATE_FORMATS.update lucene: "%Y-%m-%dT%H:%M"; end
Tire.index 'venues' do