Skip to content

Instantly share code, notes, and snippets.

@sanjay920
sanjay920 / test_openai_embeddings.py
Last active December 3, 2024 23:18
Test OpenAI Embedding API: reduce dimensionality for Matryoshka output embeddings vs no reduction
from openai import OpenAI
import time
import statistics
from typing import Dict, List
import pandas as pd
from tqdm import tqdm
def test_embeddings(with_dimensions: bool = False) -> List[float]:
client = OpenAI()
@sanjay920
sanjay920 / text-embeddings-inference-acorn.md
Created October 23, 2023 19:50
Unlocking the Power of Text Embeddings with Acorn

Unlocking the Power of Text Embeddings with Acorn

Text embeddings serve as the foundation for tasks like sentiment analysis, translation, and summarization. They also amplify the capabilities of Large Language Models (LLMs) such as GPT-4 and Llama, playing a central role in modern natural language processing.

Text embeddings are numerical representations of text that capture semantic meanings, which allows developers to use text embeddings to understand the nuances of human language as part of their LLM app pipelines.

Applications of Text Embeddings in LLMs

  1. Semantic Search:
  • Text embeddings represent the meaning and intent of a user's query and documents in a shared embedding space. This enables LLMs to facilitate semantic search, where documents similar to a user's query can be rapidly identified using vector search technology.
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-opni
namespace: opni
spec:
acme:
# You must replace this email address with your own.
# Let's Encrypt will use this to contact you about expiring
# certificates, and issues related to your account.
@sanjay920
sanjay920 / README.md
Last active February 26, 2021 00:11
Jupyter Lab for EKS

Jupyterlab installation on EKS clusters

kubectl create ns jlab
kubectl apply -f https://gist.githubusercontent.com/sanjay920/f6f2d64f7302ac286acfe0052817009f/raw/2e5b35b4e2c7ac75ec2969d71e188e54cc76b3b1/jupyterlab-pvc.yaml
kubectl apply -f https://gist.githubusercontent.com/sanjay920/f6f2d64f7302ac286acfe0052817009f/raw/2e5b35b4e2c7ac75ec2969d71e188e54cc76b3b1/jupyterlab-deployment.yaml
kubectl apply -f https://gist.githubusercontent.com/sanjay920/f6f2d64f7302ac286acfe0052817009f/raw/2e5b35b4e2c7ac75ec2969d71e188e54cc76b3b1/jupyterlab-service.yaml

# check jupyterlab external IP
k get svc -n jlab