Skip to content

Instantly share code, notes, and snippets.

View cool-RR's full-sized avatar

Ram Rachum cool-RR

View GitHub Profile
@cool-RR
cool-RR / mistral_chat.py
Last active December 15, 2023 21:52
mistral_chat.py
#!python
# Copyright Ram Rachum 2023, MIT license
# Use this command line script to have a simple interactive chat with the Mistral AI, similar to
# ChatGPT.
#
# First supply your API key like so:
# echo '{"mistral_api_key": "YOUR_API_KEY"}' > ~/.mistral_chat
import os
@cool-RR
cool-RR / filtros.py
Created July 28, 2023 17:30
Module for filtering useless deprecation warnings from Ray/RLlib
import sys
from typing import TextIO, Iterable
import logging
import re
import warnings
class FiltrosStream:
def __init__(self, original_stream: TextIO, patterns: Iterable[str] = ()) -> None:
self.original_stream = original_stream
self.patterns = tuple(patterns)
@cool-RR
cool-RR / gist:c00d93901ee007d43ef5eb842aeda85b
Last active October 25, 2022 13:53
Bill Burr standup continued using GPT-3
This is a great interview bit by Bill Burr, transcribed by Whisper and continued by GPT-3
Original interview: https://www.youtube.com/watch?v=O9YL04v-J5U
Detecting language using up to the first 30 seconds. Use `--language` to specify the language
Detected language: english
[00:00.000 --> 00:03.960] I didn't think Lance owed anybody,
[00:03.960 --> 00:06.080] he didn't do anything to me.
[00:06.080 --> 00:08.480] You know what he did for me?
[00:08.480 --> 00:12.440] He raised $500 million for cancer research.
[00:12.440 --> 00:13.600] That's what that lie did.
@cool-RR
cool-RR / ry.py
Created September 20, 2022 16:28
ry.py
from __future__ import annotations
import random
from typing import Tuple
import re
import pprint
import dataclasses
import functools
import ray.rllib.env.multi_agent_env
@cool-RR
cool-RR / reciprocity.py
Last active May 20, 2022 19:19
Experiment for showing how reciprocity can be taught
# This is a small experiment in learning reciprocity. This is part of my research, details here:
# https://r.rachum.com
#
# Feel free to run this experiment, and also play with the constants defined below.
#
# First install the dependencies:
#
# pip install gym numpy stable-baselines3
#
# Run this script, and you'll see this output:
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/coverage/parser.py", line 367, in __init__
self.code = compile_unicode(text, filename, "exec")
File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/coverage/phystokens.py", line 285, in compile_unicode
code = compile(source, filename, mode)
File "/home/travis/build/ipython/ipython/IPython/lib/deepreload.py", line 295
except KeyError as 2:
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
import time as time_module
import pprint
import collections
import traceback as traceback_module
import itertools
import threading
import sys
import inspect
@cool-RR
cool-RR / gist:e2f8e6533974ee7516ade3b17784a513
Created December 14, 2019 07:46
List of questions to ask in job interviews
Note that it should be clear who my team leader would be, and lots of these questions should be directed to them.
Also preface that lots of these seem obvious and possibly insulting. For example I wouldn't think to ask a software company whether they have a bug tracker-- Until I started working for a company and discovered they don't have a bug tracker.
Code-wise: (Need to add lots more to this!)
- Take any from Joel's list.
- Take any from https://github.com/viraptor/reverse-interview and https://news.ycombinator.com/item?id=20916749
- One-step build.
- There's a bug tracker I can open a ticket for everyone.
- When people get tagged or assigned on tickets, they get notified and actually see it without me having to manually notify them.
- Email doesn't get spammed too much, can live without filters.
- Recent versions of Python and any packages.
import numbers
import struct
import pathlib
import math
import abc
import wave as wave_module
import itertools
import re
import sortedcontainers
@cool-RR
cool-RR / gist:3ad9d0edfdfbe5fa5aea30d36f8b43d6
Created September 18, 2017 16:45
Multicolor experiment
; G-Code generated by Simplify3D(R) Version 4.0.0
; Sep 18, 2017 at 7:06:03 PM
; Settings Summary
; processName,Process1-1
; applyToModels,Multicolor experiment
; profileName,Ram's Prusa
; profileVersion,2017-08-18 10:56:04
; baseProfile,Default
; printMaterial,PLA
; printQuality,High