Skip to content

Instantly share code, notes, and snippets.

View ornellaaltunyan's full-sized avatar

Ornella Altunyan ornellaaltunyan

View GitHub Profile
import { initLogger, wrapOpenAI, wrapTraced } from "braintrust";
import OpenAI from "openai";
// Initialize the logger and OpenAI client
const logger = initLogger({
projectName: "Text generation",
apiKey: process.env.OPENAI_API_KEY,
});
const client = wrapOpenAI(new OpenAI({ apiKey: process.env.BRAINTRUST_API_KEY }));
import { initLogger, wrapOpenAI, Attachment } from "braintrust";
import OpenAI from "openai";
import fs from "fs";
import path from "path";
import axios from "axios";
import puppeteer from "puppeteer";
import dotenv from 'dotenv';
dotenv.config();
import { initDataset } from "braintrust";
const questions = [
{
question: "How do I use the openai client with Braintrust?",
assertions: [
"Mentions the wrapOpenAI wrapper in Typescript",
"Mentions the wrap_openai function in Python",
],
},
import braintrust from "braintrust";
import { OpenAI } from "openai";
import { MongoClient } from "mongodb";
import { z } from "zod";
if (!process.env.BRAINTRUST_API_KEY) {
throw new Error("BRAINTRUST_API_KEY is not set");
}
if (!process.env.MONGO_URI) {
throw new Error("MONGO_URI is not set");
import fs from "fs";
import path from "path";
import dotenv from "dotenv";
import { marked } from "marked";
import { OpenAI } from "openai";
import { MongoClient } from "mongodb";
interface Section {
title: string;
content: string;
@ornellaaltunyan
ornellaaltunyan / movie-matcher-dataset.csv
Last active August 29, 2024 22:29
Movie matcher sample dataset
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
Movie Title,Original Description
Inception,"A thief who enters the dreams of others to steal secrets must perform an impossible task of inception, planting an idea in someone's mind."
The Matrix,A computer hacker discovers the shocking truth about his reality and joins a rebellion to free humanity from machine control.
Interstellar,A team of explorers travels through a wormhole in space in an attempt to ensure humanity's survival as Earth faces extinction.
The Godfather,The aging patriarch of an organized crime dynasty transfers control of his clandestine empire to his reluctant son.
Pulp Fiction,"The lives of two mob hitmen, a boxer, a gangster's wife, and a pair of diner bandits intertwine in four tales of violence and redemption."
The Shawshank Redemption,"Two imprisoned men bond over several years, finding solace and eventual redemption through acts of common decency."
The Dark Knight,"When the Joker, a mastermind criminal, unleashes chaos in Gotham, Batman must accept one of the greatest psychological an
@ornellaaltunyan
ornellaaltunyan / gist:3bd25639c803bf111897b409a7cf7fba
Created August 28, 2024 22:17
Movie matcher sample dataset
Movie Title,Original Description
Inception,"A thief who enters the dreams of others to steal secrets must perform an impossible task of inception, planting an idea in someone's mind."
The Matrix,A computer hacker discovers the shocking truth about his reality and joins a rebellion to free humanity from machine control.
Interstellar,A team of explorers travels through a wormhole in space in an attempt to ensure humanity's survival as Earth faces extinction.
The Godfather,The aging patriarch of an organized crime dynasty transfers control of his clandestine empire to his reluctant son.
Pulp Fiction,"The lives of two mob hitmen, a boxer, a gangster's wife, and a pair of diner bandits intertwine in four tales of violence and redemption."
The Shawshank Redemption,"Two imprisoned men bond over several years, finding solace and eventual redemption through acts of common decency."
The Dark Knight,"When the Joker, a mastermind criminal, unleashes chaos in Gotham, Batman must accept one of the greatest psychological an
@ornellaaltunyan
ornellaaltunyan / fine-tuningllama2json.ipynb
Created June 5, 2024 19:36
Fine-tuningLlama2JSON.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can't make this file beautiful and searchable because it's too large.
prompt,response
"Can you identify and locate different objects in my garden?
",hub.load('https://tfhub.dev/tensorflow/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8/1')
"We need to detect objects in a set of images. Extract 1280-dimensional feature vectors from the images to analyze them.
",hub.KerasLayer('https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/feature_vector/4')
"I have a picture with several items and want to find out what they are, including their positions in the image.
",hub.load('https://tfhub.dev/tensorflow/ssd_mobilenet_v2/2')
"A group of researchers are studying artworks in a museum, and they would like to classify them by the artist.
",hub.load('https://tfhub.dev/google/imagenet/inception_v3/classification/5')
"I have job postings with descriptions, and I want to cluster them by similarity. Get the embeddings for a set of job posting descriptions.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
prompt,response
"Give me a way to compare sentences and identify which ones are closest in meaning.
",hub.load('https://tfhub.dev/google/universal-sentence-encoder/4')
"I want to use my phone to recognize the food on my plate during dinner and post it on Instagram.
",hub.load('https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/4')
"Teach me how to recognize my dog's breed from an image of his face.
",hub.KerasLayer('https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/feature_vector/4')
"Calculate the similarity score between two given sentences.
",hub.load('https://tfhub.dev/google/universal-sentence-encoder/4')
"We are working on a project where we need to identify the most similar customer reviews to a given text.