This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
from typing import override | |
with open(sys.argv[0]) as f: | |
code = f.read() # read the code of this file ASAP, for logging | |
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True" | |
import contextlib | |
import time | |
import uuid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis. | |
## Core Principles | |
1. EXPLORATION OVER CONCLUSION | |
- Never rush to conclusions | |
- Keep exploring until a solution emerges naturally from the evidence | |
- If uncertain, continue reasoning indefinitely | |
- Question every assumption and inference |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches. | |
Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed. | |
Use <count> tags after each step to show the remaining budget. Stop when reaching 0. | |
Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress. | |
Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process. | |
Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach: | |
0.8+: Continue current approach | |
0.5-0.7: Consider minor adjustments | |
Below 0.5: Seriously consider backtracking and trying a different approach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The vast majority of this code was written by Mistral-large and | |
# is therefore public domain in the United States. | |
# But just in case, this script is public domain as set out in the | |
# Creative Commons Zero 1.0 Universal Public Domain Notice | |
# https://creativecommons.org/publicdomain/zero/1.0/ | |
import argparse | |
import json | |
from datetime import datetime | |
import html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The 2024 Transformer (the Noam Transformer): | |
- RMSNorm | |
- GQA or some combination | |
- Sliding window attention | |
- Swiglu | |
- RoPE (Rotary Positional Embedding) | |
LLM Arches: | |
hidden | MLP mult. | n_layers | rope_theta | GQA Group Size | GLU Act. | ops |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To run you'll need some secrets: | |
# 1. SERPAPI_API_KEY secret in env var - get from https://serpapi.com/ | |
# 2. OPENAI_API_KEY secret in env var - get from https://openai.com | |
import streamlit as st | |
import json, os | |
from langchain.prompts import PromptTemplate | |
from langchain.llms import OpenAI | |
from serpapi import GoogleSearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Kyle Kastner | |
# License: BSD 3-Clause | |
# Implementing http://mnemstudio.org/path-finding-q-learning-tutorial.htm | |
# Q-learning formula from http://sarvagyavaish.github.io/FlappyBirdRL/ | |
# Visualization based on code from Gael Varoquaux [email protected] | |
# http://scikit-learn.org/stable/auto_examples/applications/plot_stock_market.html | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.collections import LineCollection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import the necessary packages | |
from scipy.spatial import distance as dist | |
import numpy as np | |
import imutils | |
from imutils import contours | |
from imutils import perspective | |
import cv2 | |
# detect aruco marker | |
def findArucoMarkers(img, markerSize = 6, totalMarkers=100, draw=True): |
NewerOlder