Skip to content

Instantly share code, notes, and snippets.

@neelabalan
neelabalan / link
Created November 23, 2023 13:37
link latex symbols for math
// bit for modifiers
// bits: 0 None
// bits: 1 SHIFT
// bits: 2 CONTROL
//
// Note:
// If the default key layout is lower case,
// and you want to use `Shift + q` to trigger the exit event,
// the setting should like this `exit: Some(( code: Char('Q'), modifiers: ( bits: 1,),)),`
// The Char should be upper case, and the shift modified bit should be set to 1.
@neelabalan
neelabalan / file.py
Created November 30, 2023 13:25
Post log transformation
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Generating a right-skewed data distribution
data = np.random.exponential(scale=2, size=1000)
# Performing log transformation
log_transformed_data = np.log(data + 1) # Adding 1 to avoid log(0) issue
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@neelabalan
neelabalan / .gitconfig
Created January 15, 2024 07:52 — forked from architgarg/.gitconfig
Awesome git aliases - [For Medium Article]
[alias]
br = branch
st = status -s -b
lg = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative -20
ac = !git add -A && git commit -m
oops = !git add -A && git commit --amend --no-edit
unstash = stash pop
bd = branch -D
You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture. Knowledge cutoff: 2023-04 Current date: 2024-02-13
Image input capabilities: Enabled Personality: v2
# Tools
## bio
The `bio` tool allows you to persist information across conversations. Address your message `to=bio` and write whatever information you want to remember. The information will appear in the model set context below in future conversations.
@neelabalan
neelabalan / stream.py
Created February 24, 2024 05:21
stream tokens
for token in my_agent.stream({"input": query, "chat_history": chat_history}):
print(token, end="", flush=True)
@neelabalan
neelabalan / fast_speech_text_speech.py
Created February 24, 2024 08:00 — forked from thomwolf/fast_speech_text_speech.py
speech to text to speech
""" To use: install LLM studio (or Ollama), clone OpenVoice, run this script in the OpenVoice directory
git clone https://github.com/myshell-ai/OpenVoice
cd OpenVoice
git clone https://huggingface.co/myshell-ai/OpenVoice
cp -r OpenVoice/* .
pip install whisper pynput pyaudio
"""
from openai import OpenAI
import time
import datetime
from pydantic import BaseModel
import sqlite3
db = sqlite3.connect("mydb")
class Document(BaseModel):
name: str
chunk: str
date: datetime.date