Skip to content

Instantly share code, notes, and snippets.

View janakiramm's full-sized avatar

Janakiram MSV janakiramm

View GitHub Profile
@janakiramm
janakiramm / Oscar_bot_Chroma.py
Created August 3, 2023 06:57
ChromaDB for RAG with OpenAI
View Oscar_bot_Chroma.py
import pandas as pd
import openai
import chromadb
from chromadb.utils import embedding_functions
import os
df=pd.read_csv('./data/oscars.csv')
df=df.loc[df['year_ceremony'] == 2023]
df=df.dropna(subset=['film'])
@janakiramm
janakiramm / chroma-vdb.py
Last active July 27, 2023 10:00
Chroma VectorDB for Word Embeddings
View chroma-vdb.py
import chromadb
phrases=[
"Amanda baked cookies and will bring Jerry some tomorrow.",
"Olivia and Olivier are voting for liberals in this election.",
"Sam is confused, because he overheard Rick complaining about him as a roommate. Naomi thinks Sam should talk to Rick. Sam is not sure what to do.",
"John's cookies were only half-baked but he still carries them for Mary.",
]
ids=["001","002","003","004"]
@janakiramm
janakiramm / Oscar_bot.py
Created July 20, 2023 13:34
Implementing RAG with OpenAI
View Oscar_bot.py
import openai
import tiktoken
from scipy import spatial
import pandas as pd
df=pd.read_csv('./data/oscars.csv')
print(df.head())
df=df.loc[df['year_ceremony'] == 2023]
df=df.dropna(subset=['film'])
View apps.yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
name: app
namespace: flux-system
spec:
interval: 1m
sourceRef:
kind: GitRepository
name: flux-system
View webapp-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mywebapp-ingress
namespace: mywebapp
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- http:
View webapp-service.yaml
apiVersion: v1
kind: Service
metadata:
name: web
namespace: mywebapp
labels:
name: web
app: mywebapp
spec:
selector:
View webapp.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
namespace: mywebapp
labels:
name: web
app: mywebapp
spec:
replicas: 3
View webapp-ns.yaml
apiVersion: v1
kind: Namespace
metadata:
name: mywebapp
View infrastructure.yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
name: infrastructure
namespace: flux-system
spec:
interval: 1m
sourceRef:
kind: GitRepository
name: flux-system
View ingress-helm-release.yaml
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: ingress-nginx
namespace: ingress-system
spec:
interval: 5m
chart:
spec:
chart: ingress-nginx