Skip to content

Instantly share code, notes, and snippets.

View lambdaofgod's full-sized avatar
🤗
opensource

Jakub Bartczuk lambdaofgod

🤗
opensource
View GitHub Profile
@lambdaofgod
lambdaofgod / linear_algebra_basics.org
Last active April 28, 2024 09:18
Linear algebra - intro topics

List of topics

Intro

  • basic examples - polynomials, $\mathbb{R}^n$ et c
  • basis
  • independence

Matrices and linear systems

  • row space, column space
@lambdaofgod
lambdaofgod / code2doc.py
Created April 18, 2024 13:52
generating READMEs
class MultiFileSummary(dspy.Signature):
context = dspy.InputField(desc="Python code")
question = dspy.InputField()
answer = dspy.OutputField(desc="Summary of the code given guiding question")
class RepoSummary(dspy.Signature):
context = dspy.InputField(desc="Python file summaries")
question = dspy.InputField()
answer = dspy.OutputField(desc="Repository summary")
@lambdaofgod
lambdaofgod / ot.org
Created November 22, 2023 09:32
Optimal transport in Python
import transformers
from sentence_transformers import SentenceTransformer


checked_symptoms = ["ból dupy", "jebie mnie w krzyżu"]
reference_symptoms = [["ból lędźwi"], ["ból gardła", "ból dupy"]]

model = SentenceTransformer('sdadas/st-polish-paraphrase-from-distilroberta')
checked_embeddings = model.encode(checked_symptoms)
# https://github.com/exercism/cli/issues/718#issuecomment-1493221436
#!/usr/bin/env bash
set -e
set -u
export track="$1"
curl \
from llm_rs import AutoModel
 
#Load the model, define any model you like from the list above as the `model_file`
model = AutoModel.from_pretrained("rustformers/mpt-7b-ggml",model_file="mpt-7b-q4_0-ggjt.bin")
@lambdaofgod
lambdaofgod / oasst_pythia.org
Last active April 16, 2023 18:23
OpenAssistant Pythia 6.9

openassistant/pythia

pythia-6.9b

import transformers
import torch
@lambdaofgod
lambdaofgod / docker-compose.yaml
Created April 16, 2023 09:18
OpenAssistant compose with fixed ports
version: "3.8"
services:
# Use `docker compose --profile backend-dev up --build --attach-dependencies` to start a database and work and the backend.
# Use `docker compose --profile frontend-dev up --build --attach-dependencies` to start the services needed to work on the frontend. If you want to also run the inference, add a second `--profile inference` argument.
# The profile ci is used by CI automations. (i.e E2E testing)
# This DB is for the FastAPI Backend.
@lambdaofgod
lambdaofgod / new.py
Created April 5, 2023 12:15
Renaming Python relative imports
from <project_name>.d import function
@lambdaofgod
lambdaofgod / chatgpt_org.el
Created March 14, 2023 10:33
ChatGPT in org mode
;; USING CHATGPT IN ORG MODE
;; how-to
;; relevant mlutil file - https://github.com/lambdaofgod/mlutil/blob/master/mlutil/chatgpt_api.py
;; - install mlutil (or copy relevant file somewhere so you can import it easily)
;; - M-x initialize-chatgpt-code-block
;; - M-x insert-chatgpt-response-code-block
;; - C-c C-c - you get the response
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; babel code blocks in org mode
@lambdaofgod
lambdaofgod / tmux_jupyter.sh
Created March 8, 2023 09:43
Run Jupyter lab/notebook in tmux
# tmux utils
tmux_jupyter() {
cd ~/Projects
tmux new -d -s jupyter
tmux send-keys -t jupyter "jupyter-notebook" Enter
tmux a -t jupyter
}