This file contains hidden or 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 List, Tuple | |
import logging | |
import warnings | |
from langchain.chat_models import ChatOpenAI | |
from langchain.llms import HuggingFacePipeline | |
from langchain.callbacks.manager import CallbackManager | |
from langchain.schema import AIMessage, HumanMessage, SystemMessage | |
from transformers import ( | |
AutoModelForCausalLM, AutoTokenizer, | |
TextStreamer, |
This file contains hidden or 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 langchain.chat_models import ChatOpenAI | |
from langchain.chains import LLMChain | |
from langchain import PromptTemplate | |
import time | |
import toml, os | |
import numpy as np | |
keys = toml.load("api_keys.toml") | |
os.environ["OPENAI_API_KEY"] = keys["openai_api_key"] |
This file contains hidden or 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 hidden or 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 json, requests | |
RESULTS_URL = "https://raw.githubusercontent.com/EleutherAI/pythia/main/results/json/v1.1-evals/pythia-12b-deduped/zero-shot/12b-deduped_step93000.json" | |
r = requests.get(RESULTS_URL) | |
data = json.loads(r.content) | |
results = data["results"] | |
all = list() | |
for name in data["results"]: |
This file contains hidden or 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 copy import deepcopy | |
from typing import Any, Dict, List, Tuple | |
import numpy as np | |
import torch | |
from transformers import AutoModelForCausalLM, AutoTokenizer | |
from util import nethook | |
from .ft_hparams import FTHyperParams |
This file contains hidden or 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 genepro.evo import Evolution | |
from genepro.selection import tournament_selection | |
from genepro.node_impl import * | |
from genepro.variation import * | |
from sklearn.metrics import mean_squared_error, r2_score | |
import numpy as np | |
from sympy import simplify, preorder_traversal, Float, Integer | |
import matplotlib.pyplot as plt | |
import imageio, os |