repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | helper/scheduler.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:23.733394 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: proxyScheduler
Description :
Author : JHao
date: 2019/8/5
-------------------------------------------------
Change Activity:
2019/08/05: proxyScheduler
2021/0... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | helper/validator.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:23.953235 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: _validators
Description : 定义proxy验证方法
Author : JHao
date: 2021/5/25
-------------------------------------------------
Change Activity:
2023/03/10: 支持带用户认证的代理格式 username:passwo... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | test.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.065401 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: test.py
Description :
Author : JHao
date: 2017/3/7
-------------------------------------------------
Change Activity:
2017/3/7:
---------------------------------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | test/testProxyFetcher.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.188349 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: testProxyFetcher
Description :
Author : JHao
date: 2020/6/23
-------------------------------------------------
Change Activity:
2020/6/23:
--------------------------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | test/testRedisClient.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.195292 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: testRedisClient
Description :
Author : JHao
date: 2020/6/23
-------------------------------------------------
Change Activity:
2020/6/23:
---------------------------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | test/testConfigHandler.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.196435 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: testGetConfig
Description : testGetConfig
Author : J_hao
date: 2017/7/31
-------------------------------------------------
Change Activity:
2017/7/31:
------------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | test/testProxyValidator.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.198053 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: testProxyValidator
Description :
Author : JHao
date: 2021/5/25
-------------------------------------------------
Change Activity:
2021/5/25:
------------------------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | setting.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.249411 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: setting.py
Description : 配置文件
Author : JHao
date: 2019/2/15
-------------------------------------------------
Change Activity:
2019/2/15:
-------------------------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | test/testSsdbClient.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.361672 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: testSsdbClient
Description :
Author : JHao
date: 2020/7/3
-------------------------------------------------
Change Activity:
2020/7/3:
------------------------------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | util/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.575999 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: __init__
Description :
Author : JHao
date: 2020/7/6
-------------------------------------------------
Change Activity:
2020/7/6:
------------------------------------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | util/lazyProperty.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.631908 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: lazyProperty
Description :
Author : JHao
date: 2016/12/3
-------------------------------------------------
Change Activity:
2016/12/3:
------------------------------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | proxyPool.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.679054 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: proxy_pool
Description : proxy pool 启动入口
Author : JHao
date: 2020/6/19
-------------------------------------------------
Change Activity:
2020/6/19:
--------------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | util/six.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.763185 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: six
Description :
Author : JHao
date: 2020/6/22
-------------------------------------------------
Change Activity:
2020/6/22:
-------------------------------------------------
"... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | util/singleton.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.791871 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: singleton
Description :
Author : JHao
date: 2016/12/3
-------------------------------------------------
Change Activity:
2016/12/3:
---------------------------------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | util/webRequest.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:24.816920 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: WebRequest
Description : Network Requests Class
Author : J_hao
date: 2017/7/31
-------------------------------------------------
Change Activity:
2017/7/31:
------------------... |
jhao104/proxy_pool | https://github.com/jhao104/proxy_pool | null | null | null | null | 23,322 | null | null | mit | null | null | null | null | null | null | null | test/testProxyClass.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:28.377875 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: testProxyClass
Description :
Author : JHao
date: 2019/8/8
-------------------------------------------------
Change Activity:
2019/8/8:
------------------------------------------... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/HumanEval/utils/dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:30.682402 | import os
import numpy as np
import json
class HumanEvalDataset:
def __init__(self, root, sample_num=1, language="python", issft=False):
"""
root: the path to the HumanEval dataset
sample_num: the number of samples for each prompt
language: the language of the HumanEval dataset
... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/HumanEval/eval_instruct.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:30.691498 | import argparse
import json
import os
import torch
from pathlib import Path
from tqdm import tqdm
data_abs_dir = Path(__file__).parent / "data"
from utils.utils import extract_generation_code, languge_settings
from transformers import AutoTokenizer, AutoModelForCausalLM
from human_eval.evaluation import evaluate_func... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/HumanEval/human_eval/evaluate_functional_correctness.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:30.696410 | import fire
import sys
from .data import HUMAN_EVAL
from .evaluation import evaluate_functional_correctness
def entry_point(
sample_file: str,
k: str = "1,10,100",
n_workers: int = 4,
timeout: float = 3.0,
problem_file: str = "",
is_mbpp: bool = False,
):
"""
Evaluates the functional ... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/HumanEval/human_eval/data.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:30.697997 | from typing import Iterable, Dict
import gzip
import json
import os
ROOT = os.path.dirname(os.path.abspath(__file__))
HUMAN_EVAL = os.path.join(ROOT, "..", "data", "HumanEval.jsonl.gz")
def read_problems(evalset_file: str = HUMAN_EVAL) -> Dict[str, Dict]:
return {task["task_id"]: task for task in stream_jsonl(e... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/HumanEval/human_eval/evaluation.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:30.718074 | import os
import sys
import fire
import json
import gzip
import regex
import numpy as np
import itertools
from typing import *
from tqdm.auto import tqdm
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed
from .data import stream_jsonl
from .execution import check_corre... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/HumanEval/eval_pal.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:30.719151 | import os
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
import json
import torch.distributed as dist
import subprocess
import sys
from accelerate import Accelerator
from accelerate import DistributedDataParallelKwargs
from pathlib import Path
from argparse import ArgumentParser
fro... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/HumanEval/utils/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:30.726417 | import re
languge_settings = {
'python': {
'full_name': 'Python',
'indent': 4,
},
'cpp': {
'full_name': 'cpp',
'indent': 0,
'main': "int main()",
},
'java': {
'full_name': 'Java',
'indent': 4,
'main': "public static void main",
},
... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/HumanEval/human_eval/execution.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:30.727786 | import contextlib
import faulthandler
import io
import multiprocessing
import os
import platform
import signal
import random
import subprocess
import tempfile
import gzip
import json
from typing import *
import traceback
java_exec = ""
node_exec = ""
tsc_exec = ""
go_exec = ""
php_exec = ""
cs_exec = ""
def check_cor... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/HumanEval/humaneval.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:30.742985 | import time
import string
import multiprocessing
import os
import numpy as np
import json
import re
import torch
import datetime
import subprocess
import torch.distributed as dist
from attrdict import AttrDict
from human_eval.evaluation import evaluate_functional_correctness
from transformers import AutoTokenizer
from ... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/MBPP/eval_pal.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:32.052269 | import os
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
import json
import torch.distributed as dist
import subprocess
import sys
from accelerate import Accelerator
from accelerate import DistributedDataParallelKwargs
from pathlib import Path
from argparse import ArgumentParser
fro... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/LeetCode/evaluate_leetcode.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:32.053437 | import re
import json
from pathlib import Path
from collections import defaultdict
from human_eval.evaluation import evaluate_functional_correctness
version = "20240121-Jul"
DATA_DIR = Path(__file__).parent / "data"
def extract_python_code(generation: str):
generation = generation.replace("[PYTHON]", '```python'... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/LeetCode/human_eval/data.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:32.055912 | from typing import Iterable, Dict
import gzip
import json
import os
ROOT = os.path.dirname(os.path.abspath(__file__))
HUMAN_EVAL = os.path.join(ROOT, "..", "data", "HumanEval.jsonl.gz")
def read_problems(evalset_file: str = HUMAN_EVAL) -> Dict[str, Dict]:
return {task["task_id"]: task for task in stream_jsonl(e... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/LeetCode/vllm_inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:32.056946 | from vllm import LLM, SamplingParams
import json
from transformers import AutoTokenizer
from pathlib import Path
version = "20240121-Jul"
def generate_batch(examples, tokenizer, llm, model: str):
stop = None
if model == 'deepseekcoder-instruct':
prompts = [
tokenizer.apply_chat_template([{... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/MBPP/eval_instruct.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:32.058105 | import argparse
import json
import os
import torch
import re
from pathlib import Path
from tqdm import tqdm
data_abs_dir = Path(__file__).parent / "data"
from transformers import AutoTokenizer, AutoModelForCausalLM
from human_eval.evaluation import evaluate_functional_correctness
def read_test_examples(data_path: st... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/LeetCode/human_eval/execution.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:32.059516 | import contextlib
import faulthandler
import io
import multiprocessing
import os
import platform
import signal
import random
import subprocess
import tempfile
import gzip
import json
from typing import *
import traceback
java_exec = ""
node_exec = ""
tsc_exec = ""
go_exec = ""
php_exec = ""
cs_exec = ""
def check_cor... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/LeetCode/human_eval/evaluation.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:32.060419 | import os
import json
import gzip
import numpy as np
import itertools
from typing import *
from tqdm.auto import tqdm
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed
from human_eval.data import stream_jsonl
from human_eval.execution import check_correctness
IMPORT_H... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/MBPP/human_eval/data.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:33.581322 | from typing import Iterable, Dict
import gzip
import json
import os
ROOT = os.path.dirname(os.path.abspath(__file__))
HUMAN_EVAL = os.path.join(ROOT, "..", "data", "HumanEval.jsonl.gz")
def read_problems(evalset_file: str = HUMAN_EVAL) -> Dict[str, Dict]:
return {task["task_id"]: task for task in stream_jsonl(e... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/PAL-Math/run.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:34.184199 | import os
import re
import json
import argparse
import torch
import numpy as np
from utils.parser import *
from utils.grader import *
from utils.python_executor import PythonExecutor
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
def extract_python_block_with_solution(text):
"""
... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/MBPP/utils/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:34.184769 | def cleanup_code(
code: str,
language_type: str = None,
dataset: str = None,
issft: bool = False,
stop_words = []
):
"""
Cleans up the generated code.
"""
if language_type.lower() == "python":
if issft:
code = _clean_python_code_for_sft(code)
stop_words =... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/MBPP/human_eval/evaluation.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:34.186950 | import os
import json
import gzip
import numpy as np
import itertools
from typing import *
from tqdm.auto import tqdm
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed
from .data import stream_jsonl
from .execution import check_correctness
IMPORT_HELPER = {
"python... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/PAL-Math/utils/grader.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:34.260933 | """
This logic is largely copied from the Hendrycks' MATH release (math_equivalence), and borrowed from:
- https://github.com/microsoft/ProphetNet/tree/master/CRITIC
- https://github.com/openai/prm800k
"""
import multiprocessing
from math import isclose
from typing import Union
from sympy import simplify, N
from sympy... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/MBPP/mbpp.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:34.295878 | import time
import string
import multiprocessing
import os
import numpy as np
import json
import re
import torch
import datetime
import subprocess
import torch.distributed as dist
from attrdict import AttrDict
from tqdm import tqdm
from human_eval.evaluation import evaluate_functional_correctness
from transformers impo... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/MBPP/utils/dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:34.374058 | import os
import numpy as np
import json
class MBPPDataset:
def __init__(self, root, samplenum=1):
"""
root: 数据文件的根目录
"""
self.root = root
self.data = open(os.path.join(root, "mbpp.jsonl")).readlines()
self.clean_data = self.get_qa_only_data(self.data)
self... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/MBPP/human_eval/execution.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:34.374846 | import contextlib
import faulthandler
import io
import multiprocessing
import os
import platform
import signal
import random
import subprocess
import tempfile
import gzip
import json
from typing import *
import traceback
java_exec = ""
node_exec = ""
tsc_exec = ""
go_exec = ""
php_exec = ""
cs_exec = ""
def check_cor... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/MBPP/human_eval/evaluate_functional_correctness.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:34.539063 | import fire
import sys
from .data import HUMAN_EVAL
from .evaluation import evaluate_functional_correctness
def entry_point(
sample_file: str,
k: str = "1,10,100",
n_workers: int = 4,
timeout: float = 3.0,
problem_file: str = "",
is_mbpp: bool = False,
):
"""
Evaluates the functional ... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/PAL-Math/utils/parser.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:34.614956 | """
This file come from: https://github.com/microsoft/ToRA/blob/main/src/utils/parser.py
"""
import re
from typing import Any, Dict
def _fix_fracs(string):
substrs = string.split("\\frac")
new_str = substrs[0]
if len(substrs) > 1:
substrs = substrs[1:]
for substr in substrs:
ne... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | finetune/finetune_deepseekcoder.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:34.733166 | import copy
import random
from dataclasses import dataclass, field
from typing import Optional, Dict, Sequence
import torch
import torch.distributed
import transformers
from transformers import Trainer
from datasets import load_dataset
IGNORE_INDEX = -100
EOT_TOKEN = "<|EOT|>"
def build_instruction_prompt(instructi... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | demo/app.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:34.844936 | import os
from threading import Thread
from typing import Iterator
import gradio as gr
import spaces
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
MAX_MAX_NEW_TOKENS = 2048
DEFAULT_MAX_NEW_TOKENS = 1024
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH",... |
deepseek-ai/DeepSeek-Coder | https://github.com/deepseek-ai/DeepSeek-Coder | null | null | null | null | 23,230 | null | null | mit | null | null | null | null | null | null | null | Evaluation/PAL-Math/utils/python_executor.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:39.422825 | """
This file come from: https://github.com/microsoft/ToRA/blob/main/src/utils/python_executor.py
"""
import io
import regex
import pickle
import traceback
import copy
import datetime
import multiprocessing
import dateutil.relativedelta
import multiprocess
from multiprocess import Pool
from typing import Any, Dict, Opt... |
timqian/chinese-independent-blogs | https://github.com/timqian/chinese-independent-blogs | null | null | null | null | 23,214 | null | null | mit | null | null | null | null | null | null | null | opml_generator.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:41.826525 | from xml.sax.saxutils import quoteattr
with open('blogs-original.csv', 'r') as f:
file_content = f.read()
lines = file_content.split('\n')
HEAD = '<?xml version="1.0" encoding="UTF-8"?><opml version="1.0"><head><title>中文独立博客列表</title></head><body>'
END = '</body></opml>'
ITEM = '<outline text={title} title={tit... |
timqian/chinese-independent-blogs | https://github.com/timqian/chinese-independent-blogs | null | null | null | null | 23,214 | null | null | mit | null | null | null | null | null | null | null | readme_render.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:41.849879 | import csv
csv_file_path = 'blogs-original.csv'
def main():
print("""\
# 中文独立博客列表
[](https://feeds.pub/cn-indie) [](https://t.me/indieBlogs) [:
assert tags == tags.strip(), "leading/trailing whitespace"
assert not any([tag.startswith(' ') or tag.endswith(' ') for tag in tags.split(',')]), "leading/trailing whitespace in tags"
assert not any([tag == '' for tag in tags.spli... |
KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | https://github.com/KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | Utils/NHits.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:48.410332 | from __future__ import annotations
import gc
import math
import os
import platform
import sys
import warnings
from dataclasses import dataclass
from pathlib import Path
from typing import Any
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
try:
from .DataIO import read_tabular_frame
except... |
KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | https://github.com/KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | Utils/CatBoost.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:48.411983 | from __future__ import annotations
import re
import sys
from dataclasses import dataclass
from pathlib import Path
from typing import Any
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.ticker import PercentFormatter
try:
from .DataIO import read_tabular_frame
except Import... |
KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | https://github.com/KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | Utils/ForecastStyle.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:48.416883 | from __future__ import annotations
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
class ForecastFigureStyle:
figure_size = (12.8, 6.45)
dpi = 150
actual_color = "#272829"
model_color = "#0D53E0"
grid_major = "#D5DBE6"
grid_minor = "#ECEFF4"
spine_color = "#8B919A"
t... |
KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | https://github.com/KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | Utils/TFT.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:48.419146 | from __future__ import annotations
import gc
import math
import os
import platform
import sys
import warnings
from dataclasses import dataclass
from pathlib import Path
from typing import Any
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
try:
from .DataIO import read_tabular_frame
except... |
KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | https://github.com/KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | main.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:48.419982 | from __future__ import annotations
import argparse
import importlib
import os
import sys
from collections.abc import Callable, Sequence
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from types import ModuleType
PROJECT_ROOT = Path(__file__).resolve().parent
class PipelineTarget(s... |
KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | https://github.com/KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | Utils/DataIO.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:48.420496 | from __future__ import annotations
from pathlib import Path
import pandas as pd
def read_tabular_frame(source_path: Path) -> pd.DataFrame:
if source_path.suffix.lower() == ".xlsx":
frame = pd.read_excel(source_path, engine="openpyxl")
else:
frame = pd.read_csv(source_path, sep=None, engine="... |
KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | https://github.com/KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | Utils/PatchTST.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:48.426340 | from __future__ import annotations
import gc
import math
import os
import platform
import sys
import warnings
from dataclasses import dataclass
from pathlib import Path
from typing import Any
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
try:
from .DataIO import read_tabular_frame
except... |
KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | https://github.com/KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | Utils/DataAnalysis.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:48.433208 | from __future__ import annotations
import argparse
import sys
from collections.abc import Iterable, Sequence
from dataclasses import dataclass
from pathlib import Path
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
try:
from .DataIO ... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_tools/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:52.795696 | """
Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying t... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_clean/yaml_dumper.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:52.819498 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_flip/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:52.820780 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_clean/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:52.830297 | """
Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
https://aws.amazon.com/apache2.0/
or in the "license" file accompanying ... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_tools/json_encoder.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:52.840125 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_flip/__main__.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:52.851077 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_tools/literal.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:52.851607 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_tools/_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:52.853917 | """Configuration file for cfn_flip."""
import inspect
import logging
import os
from typing import Any, Dict, NamedTuple, Optional, Type
_logger: logging.Logger = logging.getLogger(__name__)
class _ConfigArg(NamedTuple):
dtype: Type
nullable: bool = True
has_default: bool = False
default: Any = None
... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_flip/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:52.880570 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_flip/yaml_dumper.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:52.888373 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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.
A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_tools/odict.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:53.386621 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_tools/yaml_dumper.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:53.410985 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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.
A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | cfn_tools/yaml_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:53.453611 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:53.471729 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_clean.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:53.475748 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_cli.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:53.481495 | # -*- coding: utf-8 -*-
#
# tests/cli.py
#
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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.... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:53.484578 | # -*- coding: utf-8 -*-
#
# tests/cli.py
#
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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.... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_odict.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:53.487156 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_flip.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:53.489981 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_step_functions_template.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:53.987035 | import cfn_flip
import pytest
@pytest.fixture
def input_json_state_machine():
with open("examples/test_json_state_machine.json", "r") as f:
return f.read()
@pytest.fixture
def output_yaml_state_machine():
with open("examples/test_yaml_state_machine.yaml", "r") as f:
return f.read()
def tes... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_tools.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:54.012713 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
awslabs/aws-cfn-template-flip | https://github.com/awslabs/aws-cfn-template-flip | null | null | null | null | 999 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_yaml_patching.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:54.087266 | """
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | models/hf/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:56.513598 | """Hugging Face config and model.
"""
from .configuration_bd3lm import BD3LMConfig
from .modeling_bd3lm import BD3LM |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | models/ema.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:56.528522 | import torch
class ExponentialMovingAverage:
"""
Maintains (exponential) moving average of a set of parameters.
"""
def __init__(self, parameters, decay, use_num_updates=True):
"""
Args:
parameters: Iterable of `torch.nn.Parameter`; usually the result of
`model.parameters()`.
... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | diffusion.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:56.529707 | import itertools
from dataclasses import dataclass
import hydra.utils
import lightning as L
import numpy as np
import torch
import torch.nn.functional as F
import transformers
from tqdm import tqdm
from collections import OrderedDict
import dataloader
import metrics
import models
import noise_schedule
import utils
im... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | models/hf/configuration_bd3lm.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:56.536547 | """BD3LM config for Hugging Face.
"""
import transformers
class BD3LMConfig(transformers.PretrainedConfig):
"""Hugging Face configuration class for BD3LM."""
model_type = "bd3lm"
def __init__(
self,
block_size: int = 1,
vocab_size: int = 50258,
model_length: int = 1024,
cross_attn: bool =... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | models/autoregressive.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:56.541593 | import math
import typing
import flash_attn
import flash_attn.layers.rotary
import huggingface_hub
import omegaconf
import torch
import torch.nn as nn
import torch.nn.functional as F
from einops import rearrange
# Flags required to enable jit fusion kernels
torch._C._jit_set_profiling_mode(False)
torch._C._jit_set_pr... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | dataloader.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:56.573276 | import functools
import itertools
import json
import math
import os
import re
import shutil
import typing
import urllib
import zipfile
from typing import Optional
import datasets
import fsspec
import requests
import tokenizers
import torch
import transformers
import utils
LOGGER = utils.get_logger(__name__)
def wt... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | metrics.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:56.624940 | import torch
from torch import Tensor
import torchmetrics
import typing
from typing import Union
import transformers
import os
import torch.nn.functional as F
from tqdm import tqdm
import math
LOG2 = torch.log(torch.tensor(2.0))
class NLL(torchmetrics.aggregation.MeanMetric):
pass
class BPD(NLL):
def compute(sel... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | main.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:56.648818 | import os
import fsspec
import hydra
import lightning as L
import omegaconf
import rich.syntax
import rich.tree
import torch
import transformers
import dataloader
import diffusion
import utils
omegaconf.OmegaConf.register_new_resolver(
'cwd', os.getcwd)
omegaconf.OmegaConf.register_new_resolver(
'device_count', t... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | models/dit.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:56.674487 | import math
import typing
import einops
from einops import rearrange
from functools import partial
try:
import flash_attn
import flash_attn.layers.rotary
except:
pass
import huggingface_hub
import omegaconf
import torch
import torch.nn as nn
import torch.nn.functional as F
try:
from torch.nn.attention.flex_at... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | models/hf/modeling_bd3lm.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:57.299874 | """BD3LM model for Hugging Face.
"""
import math
import typing
import einops
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import transformers
from transformers import modeling_outputs
try:
from torch.nn.attention.flex_attention import flex_attention, create_block_... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | ssd-lm/generate_text.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:57.497904 | import argparse
import json
import logging
import math
import os
import time
import accelerate
import datasets
import torch
from accelerate import Accelerator
from huggingface_hub.file_download import hf_hub_download
from transformers import AutoConfig, AutoTokenizer, AutoModelForMaskedLM
from tqdm.auto import tqdm
... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | push_to_hf.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:57.595706 | import torch
import transformers
from models.hf import BD3LMConfig
from models.hf import BD3LM
BLOCK_SIZE=16
BD3LMConfig.register_for_auto_class()
BD3LM.register_for_auto_class('AutoModelForMaskedLM')
device = 'cuda'
tokenizer = transformers.AutoTokenizer.from_pretrained('gpt2')
name_or_path = f'kuleshov-group/bd3lm-... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | ssd-lm/evaluation/evaluate.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:57.606465 | import pandas as pd
from pathlib import Path
import os
import numpy as np
import click
import math
import torch
import torch.nn as nn
import argparse
import json
import os
import operator
import logging
import random
from functools import partial
from collections import Counter
from scipy import stats
from multiproc... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | noise_schedule.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:57.609606 | import abc
import torch
import torch.nn as nn
def get_noise(config, noise_type=None):
if noise_type is None:
noise_type = config.noise.type
if noise_type == 'loglinear':
return LogLinearNoise()
elif noise_type == 'square':
return ExpNoise(2)
elif noise_type == 'square_root':
return ExpNoise(0.... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | scripts/log_sample_stats.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:57.775430 | import csv
import os
import numpy as np
dir_name = 'sample_logs'
# report averages
for fname in os.listdir(dir_name):
with open(f'{dir_name}/{fname}', 'r') as f:
fieldnames = ['gen_ppl', 'nfes', 'entropy', 'gen_lengths', 'samples', 'seed']
reader = csv.DictReader(f, fieldnames=fieldnames)
rows = list(re... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | ssd-lm/evaluation/generate.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:57.805405 | import pandas as pd
from pathlib import Path
import os
import numpy as np
import click
import math
import torch
import torch.nn as nn
import argparse
import json
import os
import operator
import logging
import random
import time
from functools import partial
from collections import Counter
from scipy import stats
fr... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | ssd-lm/ssd_model_decode.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:57.916976 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. 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/LI... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | ssd-lm/report_genppl.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:58.013640 | import json
import transformers
import sys
import glob
import os
sys.path.append('../')
import torch
from tqdm import tqdm
import metrics
from omegaconf import OmegaConf
config_dict = {
'block_size': 25,
'algo': 'ssd-lm',
'training': {
'importance_sampling': False,
'sampling_eps'... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | ssd-lm/ssd_model_train.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:58.090780 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. 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/LI... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | ssd-lm/ssd_model_decode_fileio.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:58.099932 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. 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/LI... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | ssd-lm/ssd_process_data.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:58.197337 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. 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/LI... |
kuleshov-group/bd3lms | https://github.com/kuleshov-group/bd3lms | null | null | null | null | 998 | null | null | apache-2.0 | null | null | null | null | null | null | null | utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:29:58.202755 | """Console logger utilities.
Copied from https://github.com/HazyResearch/transformers/blob/master/src/utils/utils.py
Copied from https://docs.python.org/3/howto/logging-cookbook.html#using-a-context-manager-for-selective-logging
"""
import csv
import functools
import logging
import math
import fsspec
import lightnin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.