This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import tqdm | |
import wandb | |
from openai import OpenAI | |
from time import sleep | |
from pathlib import Path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openai | |
import wandb | |
openai.api_key = "sk-..." # supply your API key however you choose | |
# https://platform.openai.com/docs/models | |
tbl = wandb.Table("my_table", columns=["input", "output", "temperature"]) | |
query = "hello world" | |
systemp_prompts = "you are friendly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Recently, this problem was solved correctly. Here is the answer which turned out to be perfectly correct. | |
Note how the answer is documented step-by-step in a way that uses complex reasoning. | |
The person who discovered this solution always showed how they arrived on the decision to | |
execute the most efficient possible choice about what to do next, and clearly relied on | |
error-free code, calculators & fact-checked outside data sources to provide perfectly accurate answers at every step." | |
--------------- | |
Here's a prompt that works really well to get GPT-4 to shorten text: I often use it to make my tweets fit in 280 characters: | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# In this notebook we will automatically generate a set of evaluation questions based on wandb docs | |
import random | |
import wandb | |
import re | |
import openai | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import langchain | |
import wandb | |
from typing import Any, Awaitable, Callable, Dict, Optional, Union | |
from fastapi.responses import StreamingResponse as _StreamingResponse | |
from langchain.chains.base import Chain | |
from starlette.background import BackgroundTask | |
from starlette.types import Send | |
from dotenv import load_dotenv |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Callable, Dict, Any, List | |
from fastapi import Depends, FastAPI | |
from fastapi.encoders import jsonable_encoder | |
from fastapi.responses import JSONResponse | |
from lanarky.responses import StreamingResponse | |
from langchain.callbacks.manager import AsyncCallbackManager | |
from langchain.callbacks.base import AsyncCallbackHandler | |
from langchain.chat_models import ChatOpenAI | |
from langchain.chains import LLMChain, SequentialChain, ConversationChain | |
from pydantic import BaseModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Callable, Dict, Any, List | |
from fastapi import Depends, FastAPI | |
from fastapi.encoders import jsonable_encoder | |
from fastapi.responses import JSONResponse | |
from lanarky.responses import StreamingResponse | |
from langchain.callbacks.manager import AsyncCallbackManager | |
from langchain.callbacks.base import AsyncCallbackHandler | |
from langchain.chat_models import ChatOpenAI | |
from langchain.chains import LLMChain, SequentialChain, ConversationChain | |
from pydantic import BaseModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Needs datasets, albumentations | |
from PIL import Image | |
from datasets import load_dataset | |
from datasets.download.download_manager import DownloadMode #, REUSE_DATASET_IF_EXISTS, REUSE_CACHE_IF_EXISTS | |
import albumentations as A | |
from albumentations.pytorch.transforms import ToTensorV2 | |
from albumentations.augmentations.transforms import Normalize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Decision Boundary Utils | |
-# Modified from https://github.com/tmadl/highdimensional-decision-boundary-plot | |
-class DBPlot(BaseEstimator): | |
- def __init__( | |
- self, | |
- estimator=KNeighborsClassifier(n_neighbors=10), | |
- acceptance_threshold=0.03, | |
- n_decision_boundary_keypoints=60, | |
- n_connecting_keypoints=None, | |
- n_interpolated_keypoints=None, |
NewerOlder