python_code stringlengths 0 992k | repo_name stringlengths 8 46 | file_path stringlengths 5 162 |
|---|---|---|
"""
Author: Joon Sung Park (joonspk@stanford.edu)
File: gpt_structure.py
Description: Wrapper functions for calling OpenAI APIs.
"""
import json
import random
import openai
import time
from utils import *
openai.api_key = openai_api_key
def temp_sleep(seconds=0.1):
time.sleep(seconds)
def ChatGPT_single_request... | generative_agents-main | reverie/backend_server/persona/prompt_template/gpt_structure.py |
"""
Author: Joon Sung Park (joonspk@stanford.edu)
File: run_gpt_prompt.py
Description: Defines all run gpt prompt functions. These functions directly
interface with the safe_generate_response function.
"""
import re
import datetime
import sys
import ast
sys.path.append('../../')
from global_methods import *
from per... | generative_agents-main | reverie/backend_server/persona/prompt_template/run_gpt_prompt.py |
"""
Author: Joon Sung Park (joonspk@stanford.edu)
File: print_prompt.py
Description: For printing prompts when the setting for verbose is set to True.
"""
import sys
sys.path.append('../')
import json
import numpy
import datetime
import random
from global_methods import *
from persona.prompt_template.gpt_structure i... | generative_agents-main | reverie/backend_server/persona/prompt_template/print_prompt.py |
"""
Author: Joon Sung Park (joonspk@stanford.edu)
File: defunct_run_gpt_prompt.py
Description: Defines all run gpt prompt functions. These functions directly
interface with the safe_generate_response function.
Note (March 10, 2023) -- Defunct
"""
import re
import datetime
import sys
sys.path.append('../../')
from gl... | generative_agents-main | reverie/backend_server/persona/prompt_template/defunct_run_gpt_prompt.py |
"""
Author: Joon Sung Park (joonspk@stanford.edu)
File: scratch.py
Description: Defines the short-term memory module for generative agents.
"""
import datetime
import json
import sys
sys.path.append('../../')
from global_methods import *
class Scratch:
def __init__(self, f_saved):
# PERSONA HYPERPARAMETERS
... | generative_agents-main | reverie/backend_server/persona/memory_structures/scratch.py |
"""
Author: Joon Sung Park (joonspk@stanford.edu)
File: spatial_memory.py
Description: Defines the MemoryTree class that serves as the agents' spatial
memory that aids in grounding their behavior in the game world.
"""
import json
import sys
sys.path.append('../../')
from utils import *
from global_methods import *
... | generative_agents-main | reverie/backend_server/persona/memory_structures/spatial_memory.py |
"""
Author: Joon Sung Park (joonspk@stanford.edu)
File: associative_memory.py
Description: Defines the core long-term memory module for generative agents.
Note (May 1, 2023) -- this class is the Memory Stream module in the generative
agents paper.
"""
import sys
sys.path.append('../../')
import json
import datetime... | generative_agents-main | reverie/backend_server/persona/memory_structures/associative_memory.py |
"""
Author: Joon Sung Park (joonspk@stanford.edu)
File: global_methods.py
Description: Contains functions used throughout my projects.
"""
import random
import string
import csv
import time
import datetime as dt
import pathlib
import os
import sys
import numpy
import math
import shutil, errno
from os import listdir
... | generative_agents-main | environment/frontend_server/global_methods.py |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'frontend_server.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rais... | generative_agents-main | environment/frontend_server/manage.py |
generative_agents-main | environment/frontend_server/frontend_server/__init__.py | |
from storages.backends.s3boto import S3BotoStorage
StaticRootS3BotoStorage = lambda: S3BotoStorage(location='static')
MediaRootS3BotoStorage = lambda: S3BotoStorage(location='media')
| generative_agents-main | environment/frontend_server/frontend_server/utils.py |
"""frontend_server URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cla... | generative_agents-main | environment/frontend_server/frontend_server/urls.py |
"""
WSGI config for frontend_server project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJAN... | generative_agents-main | environment/frontend_server/frontend_server/wsgi.py |
"""
Django settings for frontend_server project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import... | generative_agents-main | environment/frontend_server/frontend_server/settings/local.py |
###FOR PUSHING STATIC TO AWS
# from .base import *
# from .production import *
# try:
# from .local import *
# except:
# pass
###FOR GENERAL USES
from .base import *
try:
from .local import *
live = False
except:
live = True
if live:
from .production import *
| generative_agents-main | environment/frontend_server/frontend_server/settings/__init__.py |
"""
Django settings for frontend_server project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import... | generative_agents-main | environment/frontend_server/frontend_server/settings/base.py |
from django.db import models | generative_agents-main | environment/frontend_server/translator/models.py |
generative_agents-main | environment/frontend_server/translator/__init__.py | |
from django.apps import AppConfig
class TranslatorConfig(AppConfig):
name = 'translator'
| generative_agents-main | environment/frontend_server/translator/apps.py |
from django.contrib import admin
from .models import *
| generative_agents-main | environment/frontend_server/translator/admin.py |
from django.test import TestCase
# Create your tests here.
| generative_agents-main | environment/frontend_server/translator/tests.py |
"""
Author: Joon Sung Park (joonspk@stanford.edu)
File: views.py
"""
import os
import string
import random
import json
from os import listdir
import os
import datetime
from django.shortcuts import render, redirect, HttpResponseRedirect
from django.http import HttpResponse, JsonResponse
from global_methods import *
fr... | generative_agents-main | environment/frontend_server/translator/views.py |
# Generated by Django 2.2 on 2023-03-27 08:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('translator', '0002_evaldata_target_agent'),
]
operations = [
migrations.AlterField(
model_name='evaldata',
name='targe... | generative_agents-main | environment/frontend_server/translator/migrations/0003_auto_20230327_0851.py |
generative_agents-main | environment/frontend_server/translator/migrations/__init__.py | |
# Generated by Django 2.2 on 2023-03-30 02:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('translator', '0003_auto_20230327_0851'),
]
operations = [
migrations.AddField(
model_name='evaldata',
name='q1_v5',
... | generative_agents-main | environment/frontend_server/translator/migrations/0004_auto_20230330_0204.py |
# Generated by Django 2.2 on 2023-03-27 06:21
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='EvalData',
fields=[
('id', models.AutoField(a... | generative_agents-main | environment/frontend_server/translator/migrations/0001_initial.py |
# Generated by Django 2.2 on 2023-03-27 08:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('translator', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='evaldata',
name='target_agent',
... | generative_agents-main | environment/frontend_server/translator/migrations/0002_evaldata_target_agent.py |
# Generated by Django 2.2 on 2023-07-02 06:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('translator', '0004_auto_20230330_0204'),
]
operations = [
migrations.DeleteModel(
name='EvalData',
),
]
| generative_agents-main | environment/frontend_server/translator/migrations/0005_delete_evaldata.py |
import random
from collections import Counter
from typing import List, Tuple, Dict
def sample_outputs(prompt: str, question: str, language_model, num_samples: int) -> List[Tuple[str, str]]:
sampled_outputs = []
for _ in range(num_samples):
output = language_model.generate(prompt, question)
reas... | COT-SC-main | sc.py |
import torch
from medpalm.model import MedPalm
#usage
img = torch.randn(1, 3, 256, 256)
caption = torch.randint(0, 20000, (1, 1024))
model = MedPalm()
output = model(img, caption)
print(output.shape) # (1, 1024, 20000)
| Med-PaLM-main | example.py |
from medpalm.model import MedPalm | Med-PaLM-main | medpalm/__init__.py |
import torch
import torch.nn as nn
from transformers import AutoTokenizer, CLIPProcessor
from medpalm.transformer import (
AutoregressiveWrapper,
Decoder,
Encoder,
Transformer,
ViTransformerWrapper,
)
class MedPalmTokenizer:
def __init__(self):
try:
self.processor = CLIP... | Med-PaLM-main | medpalm/model.py |
from functools import partial
from typing import Optional
import torch
from torch import nn, einsum, Tensor
import torch.nn.functional as F
from collections import namedtuple
from functools import wraps
from packaging import version
from dataclasses import dataclass
from einops import rearrange
# constants
Efficie... | Med-PaLM-main | medpalm/attend.py |
import math
from dataclasses import dataclass
from functools import partial, wraps
from inspect import isfunction
# constants
from math import ceil
from random import random
from typing import Callable, List, Optional
import torch
import torch.nn.functional as F
from einops import pack, rearrange, reduce, repeat, unp... | Med-PaLM-main | medpalm/transformer.py |
from setuptools import setup, find_packages
setup(
name = 'Sophia-Optimizer',
packages = find_packages(exclude=[]),
version = '0.2.1',
license='APACHE',
description = 'Sophia Optimizer ULTRA FAST',
author = 'Kye Gomez',
author_email = 'kye@apac.ai',
long_description_content_type = 'text/markdown',
ur... | Sophia-main | setup.py |
import torch
from torch import nn
from sophia.sophia import SophiaG
#define super simple model
model = nn.Sequential(
nn.Linear(10, 5),
nn.ReLU(),
nn.Linear(5, 2)
)
#define a loss func
loss = nn.CrossEntropyLoss()
#optimize
optimizer = SophiaG(model.parameters(), lr=0.01, betas=(0.9, 0.999), rho=0.04, ... | Sophia-main | example.py |
import torch
import multiprocessing
from itertools import chain
from datasets import load_dataset
from transformers import GPT2LMHeadModel, GPT2Tokenizer, GPT2Config
from transformers import DataCollatorForLanguageModeling
from transformers import Trainer, TrainingArguments
# from Sophia.decoupled_sophia.decoupled_soph... | Sophia-main | experiments/training.py |
import multiprocessing
from itertools import chain
from datasets import load_dataset
from transformers import AutoTokenizer
class CFG:
SEQ_LEN: int = 1024
NUM_CPU: int = multiprocessing.cpu_count()
TOKENIZER: str = "gpt2"
def build_dataset():
tokenizer = AutoTokenizer.from_pretrained(CFG.TOKENIZER)
... | Sophia-main | experiments/preprocssing/build_dataset.py |
from sophia.sophia import SophiaG, sophiag | Sophia-main | Sophia/__init__.py |
import math
import torch
from torch import Tensor
from torch.optim.optimizer import Optimizer
from typing import List, Optional
class SophiaG(Optimizer):
"""
SophiaG optimizer class.
"""
def __init__(self, params, lr=1e-4, betas=(0.965, 0.99), rho = 0.04,
weight_decay=1e-1, *, maximize: bool ... | Sophia-main | Sophia/Sophia.py |
MIT-main | MIT/model.py | |
import torch
from nevax.model import Neva
#usage
img = torch.randn(1, 3, 256, 256)
caption = torch.randint(0, 20000, (1, 1024))
model = Neva()
output = model(img, caption)
print(output.shape) # (1, 1024, 20000)
| NeVA-main | example.py |
from nevax.model import Neva
| NeVA-main | nevax/__init__.py |
import torch
import torch.nn as nn
from transformers import AutoTokenizer, CLIPProcessor
from nevax.transformer import (
Decoder,
Encoder,
Transformer,
ViTransformerWrapper,
)
class NevaTokenizer:
def __init__(self):
try:
self.processor = CLIPProcessor.from_pretrained("laion... | NeVA-main | nevax/model.py |
from functools import partial
from typing import Optional
import torch
from torch import nn, einsum, Tensor
import torch.nn.functional as F
from collections import namedtuple
from functools import wraps
from packaging import version
from dataclasses import dataclass
from einops import rearrange
# constants
Efficie... | NeVA-main | nevax/attend.py |
import math
from dataclasses import dataclass
from functools import partial, wraps
from inspect import isfunction
# constants
from math import ceil
from random import random
from typing import Callable, List, Optional
import torch
import torch.nn.functional as F
from einops import pack, rearrange, reduce, repeat, unp... | NeVA-main | nevax/transformer.py |
Gemini-main | geminix/__init__.py | |
class Gemini:
def __init__(self):
pass
| Gemini-main | geminix/model.py |
import math
import torch
from functools import partial
from torch import nn, einsum
from torch.autograd.function import Function
from einops import rearrange
from torch.jit import fork, wait
from torch.cuda.amp import autocast, GradScaler
from torch.nn import DataParallel
# constants
EPSILON = 1e-10
# helper funct... | FlashAttention20-main | attention.py |
import torch
import torch.cuda
import time
import psutil
from attention import FlashAttention
def test_memory_usage():
attention = FlashAttention(dim=512, heads=8, dim_head=64).cuda()
x = torch.randn(1, 1000, 512).cuda()
torch.cuda.synchronize()
start_mem = torch.cuda.memory_allocated()
out = atten... | FlashAttention20-main | test.py |
Math-Arxviv-main | example.py | |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | setup.py |
import argparse
import json
import logging
import os
import numpy as np
import torch
import transformers
from huggingface_hub import HfApi, hf_hub_download
from alpaca_farm.models.reward_model import RewardConfig, RewardModel
from alpaca_farm.utils import stable_resize_token_embeddings_and_tokenizer
min_transformers... | alpaca_farm-main | pretrained_models/recover_model_weights.py |
import torch
from alpaca_farm import torch_ops
def test_batch_select():
input = torch.tensor(
[
[0, 1, 2],
[3, 0, 9],
[6, 7, 8],
]
)
index = torch.tensor([[0, 1], [1, 0], [0, 0]])
actual = torch_ops.batch_select(input, index)
expected = torch.te... | alpaca_farm-main | tests/test_torch_ops.py |
import transformers
from alpaca_farm import utils
def test_stable_resize_token_embeddings():
model_name_or_paths = (
"gpt2", # Tied weights.
"/juice5/scr5/nlp/llama_model/llama_hf_latest/llama-teeny", # Untied weights.
)
for model_name_or_path in model_name_or_paths:
model: tran... | alpaca_farm-main | tests/test_utils.py |
import fire
import pytest
import torch
import tqdm
import transformers
from ml_swissknife import utils
from torch import nn
from transformers.models.opt import modeling_opt
from transformers.utils import logging
from alpaca_farm import constants
from alpaca_farm.flash_models import flash_opt
logger = logging.get_logg... | alpaca_farm-main | tests/test_flash_opt.py |
import copy
from typing import Optional
import fire
import torch
import transformers
from flash_attn.bert_padding import unpad_input
from torch import nn
from transformers.models.llama import modeling_llama
from alpaca_farm import utils
from alpaca_farm.flash_models import apex_patch, flash_llama
class LLaMADecoder... | alpaca_farm-main | tests/test_flash_llama.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | examples/oai_baselines.py |
import os
import transformers
from accelerate import DistributedDataParallelKwargs
from alpaca_farm import accelerate_patch, data_utils, logging
from alpaca_farm.rl.quark_trainer import QuarkTrainer, make_models, make_tokenizer
from alpaca_farm.rl.quark_utils import DataArguments, TrainingArguments
logger = logging.... | alpaca_farm-main | examples/rlhf_quark.py |
alpaca_farm-main | examples/__init__.py | |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | examples/reward_modeling.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | examples/supervised.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | examples/rlhf_ppo.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | examples/best_of_n.py |
import re
import sys
def update_version(file_path, new_version):
# Read in the file
with open(file_path, "r") as file:
filedata = file.read()
# Replace the target string
version_regex = r"__version__ = ['\"]([^'\"]*)['\"]"
filedata = re.sub(version_regex, f"__version__ = '{new_version}'",... | alpaca_farm-main | .github/workflows/set_version.py |
# Copyright 2023 The Alpaca Team
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | alpaca_farm-main | src/alpaca_farm/logging.py |
# Copyright 2023 The Alpaca Team
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | alpaca_farm-main | src/alpaca_farm/trainer_utils.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/constants.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/__init__.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | alpaca_farm-main | src/alpaca_farm/types.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | alpaca_farm-main | src/alpaca_farm/reward_modeling_trainer.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/data_utils.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | alpaca_farm-main | src/alpaca_farm/openai_utils.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/common.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | alpaca_farm-main | src/alpaca_farm/utils.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/distributed_utils.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/data_postprocessor.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | alpaca_farm-main | src/alpaca_farm/torch_ops.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/accelerate_patch.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/data_preprocessor.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/models/rl_models.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/models/__init__.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/models/reward_model.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/auto_annotations/__init__.py |
import json
import logging
from pathlib import Path
from typing import Any, Optional, Sequence, Union
import alpaca_eval.annotators as eval_annotators
import alpaca_eval.utils as eval_utils
import datasets
import pandas as pd
from alpaca_eval import metrics
from .. import constants
__all__ = ["alpaca_leaderboard", "... | alpaca_farm-main | src/alpaca_farm/auto_annotations/eval.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/flash_models/flash_llama.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/flash_models/tensor_ops.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/flash_models/__init__.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/flash_models/flash_opt.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/flash_models/apex_patch.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/inference/__init__.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/inference/decode.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/inference/score.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/rl/quark_trainer.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/rl/quark_utils.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/rl/__init__.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/rl/kl_controller.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/rl/ppo_trainer.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/rl/rl_trainer.py |
# Copyright 2023 The Alpaca Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | alpaca_farm-main | src/alpaca_farm/rl/ppo_utils.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.