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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
flagos-ai/FlagGems | https://github.com/flagos-ai/FlagGems | null | null | null | null | 981 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmark/test_batch_norm_backward.py | null | null | null | null | null | null | Python | 2026-05-04T02:33:54.453411 | import pytest
import torch
import flag_gems
from . import base, consts
# TODO(Qiming): Consolidate this to a base package
class NormBenchmark(base.GenericBenchmark):
# TODO: add new metric
def set_more_shapes(self):
return [
# 3D shapes represented as [batch_size, channels, hidden_size]... |
flagos-ai/FlagGems | https://github.com/flagos-ai/FlagGems | null | null | null | null | 981 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmark/test_bincount.py | null | null | null | null | null | null | Python | 2026-05-04T02:33:54.505819 | import pytest
import torch
import flag_gems
from . import base, consts
def bincount_input_fn(shape, dtype, device):
if shape[0] > 1_000_000:
return
n = shape[0]
for num_classes in [10, 256, 4096]:
inp = torch.randint(0, num_classes, (n,), dtype=torch.int64, device=device)
yield... |
flagos-ai/FlagGems | https://github.com/flagos-ai/FlagGems | null | null | null | null | 981 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmark/test_bitwise_and.py | null | null | null | null | null | null | Python | 2026-05-04T02:33:54.531885 | import pytest
import torch
from . import base, consts
@pytest.mark.bitwise_and_tensor
def test_bitwise_and():
bench = base.BinaryPointwiseBenchmark(
op_name="bitwise_and",
torch_op=torch.bitwise_and,
dtypes=consts.INT_DTYPES + consts.BOOL_DTYPES,
)
bench.run()
@pytest.mark.bitwi... |
flagos-ai/FlagGems | https://github.com/flagos-ai/FlagGems | null | null | null | null | 981 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmark/test_bitwise_not.py | null | null | null | null | null | null | Python | 2026-05-04T02:33:55.231290 | import pytest
import torch
from . import base, consts
@pytest.mark.bitwise_not
def test_bitwise_not():
bench = base.UnaryPointwiseBenchmark(
op_name="bitwise_not", torch_op=torch.bitwise_not, dtypes=consts.INT_DTYPES
)
bench.run()
@pytest.mark.bitwise_not_
def test_bitwise_not_inplace():
be... |
flagos-ai/FlagGems | https://github.com/flagos-ai/FlagGems | null | null | null | null | 981 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmark/test_bitwise_left_shift.py | null | null | null | null | null | null | Python | 2026-05-04T02:33:55.343228 | from typing import Generator
import pytest
import torch
from . import base, consts, utils
class BitwiseLeftShiftBenchmark(base.Benchmark):
def set_more_shapes(self):
special_shapes_2d = [(1024, 2**i) for i in range(0, 20, 4)]
sp_shapes_3d = [(64, 64, 2**i) for i in range(0, 15, 4)]
retur... |
flagos-ai/FlagGems | https://github.com/flagos-ai/FlagGems | null | null | null | null | 981 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmark/test_addmm.py | null | null | null | null | null | null | Python | 2026-05-04T02:33:56.672249 | import pytest
import torch
import flag_gems
from . import base, consts
def _input_fn(b, m, n, k, dtype, device, b_column_major):
inp1 = torch.randn([m, k], dtype=dtype, device=device)
bias = torch.randn([m, n], dtype=dtype, device=device)
if b_column_major:
inp2 = torch.randn([n, k], dtype=dtype... |
flagos-ai/FlagGems | https://github.com/flagos-ai/FlagGems | null | null | null | null | 981 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmark/test_addcmul.py | null | null | null | null | null | null | Python | 2026-05-04T02:33:56.787963 | import pytest
import torch
from . import base, consts, utils
def _input_fn(shape, dtype, device):
inp1 = utils.generate_tensor_input(shape, dtype, device)
inp2 = utils.generate_tensor_input(shape, dtype, device)
inp3 = utils.generate_tensor_input(shape, dtype, device)
yield inp1, inp2, inp3, {"value... |
flagos-ai/FlagGems | https://github.com/flagos-ai/FlagGems | null | null | null | null | 981 | null | null | apache-2.0 | null | null | null | null | null | null | null | benchmark/test_asinh.py | null | null | null | null | null | null | Python | 2026-05-04T02:33:58.583913 | import pytest
import torch
from . import base, consts
@pytest.mark.asinh
def test_asinh():
bench = base.UnaryPointwiseBenchmark(
op_name="asinh", torch_op=torch.asinh, dtypes=consts.FLOAT_DTYPES
)
bench.run()
@pytest.mark.asinh_
def test_asinh_inplace():
bench = base.UnaryPointwiseBenchmark... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | applications/cambridge_restaurants/camrest_dst.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:01.798114 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | applications/cambridge_restaurants/cambridge_restaurants_agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:01.802559 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | applications/conv_app.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:01.804660 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | applications/cambridge_restaurants/camrest_nlg.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:01.805699 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | docs/conf.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:01.808447 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | applications/cambridge_restaurants/camrest_nlu.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:01.809802 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | mkdocs/autogen.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:01.810902 | # -*- coding: utf-8 -*-
'''
Documentation Generator
This code is a modified and adapted version of Keras' autogen.py
'''
from __future__ import print_function
from __future__ import unicode_literals
import inspect
import os
import sys
import re
sys.path.append("../")
import ludwig
EXCLUDE = {}
# For each class t... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_manager/dialogue_manager.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:03.701684 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_manager/dialogue_manager_generic.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:03.707880 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/conversational_module.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:03.711644 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | mkdocs/code_doc_autogen.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:03.714182 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Uber Technologies, Inc.
#
# 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 ... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_policy/calculated_policy.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:04.666540 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_policy/reinforcement_learning/q_policy.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:04.908448 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_policy/dialogue_policy.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:05.247364 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_policy/reinforcement_learning/wolf_phc_policy.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:05.248811 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_policy/deep_learning/reinforce_policy.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:05.337702 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_policy/slot_filling_policy.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:05.339389 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_policy/random_policy.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:05.360677 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_policy/deep_learning/ludwig_policy.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:06.483049 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_policy/reinforcement_learning/reward_function.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:06.484242 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_state_tracker/ludwig_dst.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:06.765496 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_policy/deep_learning/supervised_policy.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:06.878048 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_policy/reinforcement_learning/minimax_q_policy.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:07.008338 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/nlg/nlg.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:07.122596 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/nlg/ludwig_nlg.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:07.233763 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/nlg/slot_filling_nlg.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:07.418377 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/nlu/ludwig_nlu.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:08.062944 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/nlu/nlu.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:08.103173 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/nlu/slot_filling_nlu.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:08.103887 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/user_simulator/agenda_based_user_simulator/agenda.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:08.546536 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_state_tracker/slot_filling_dst.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:11.028148 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/joint_model/metal_woz_seq2seq.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:11.028739 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
uber-archive/plato-research-dialogue-system | https://github.com/uber-archive/plato-research-dialogue-system | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | plato/agent/component/dialogue_state_tracker/dialogue_state_tracker.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:11.068817 | """
Copyright (c) 2019-2020 Uber Technologies, Inc.
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... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/blender/config.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:13.640860 | from dataclasses import dataclass, field
from dataclasses_json import dataclass_json
@dataclass_json
@dataclass
class BlenderConfig:
device:str = field(default="cuda",
metadata={"help": "Device, cuda or cpu or mps"}
)
use_tqdm:bool = field(default=True,
metadata={"help": "Use tqdm progress b... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/candidates_generation/eval_candidates.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:13.648815 | """
Eval results will be continuously saved to ../../data/prepared/{dataset_name}/{set_name}/dataset.jsonl
"""
import argparse
import sys
import os
import psutil
import json
import random
import numpy as np
import tabulate
from tqdm import tqdm
from collections import defaultdict
sys.path.append(os.path.dirname(os.... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:13.658503 | from llm_blender.blender.blender import Blender
from llm_blender.pair_ranker.config import RankerConfig
from llm_blender.gen_fuser.config import GenFuserConfig
from llm_blender.blender.config import BlenderConfig
|
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/blender/blender_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:13.659559 |
import os
import torch
import logging
import numpy as np
import safetensors
from pathlib import Path
from ..pair_ranker.model_util import (
build_ranker,
build_tokenizer,
build_collator,
)
from ..pair_ranker.config import RankerConfig
from ..gen_fuser.config import GenFuserConfig
from transformers import (... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/candidates_generation/engine.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:13.660804 | """
This file is taken from This file is modified based on:
https://github.com/Ravoxsg/SummaReranker-ACL-22-/blob/main/src/candidate_generation/engine.py
We thank the authors for sharing their code.
"""
import gc
from tqdm import tqdm
import torch
import numpy as np
import torch.nn.functional as F
from tran... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/blender/blender.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:13.694683 | import logging
import torch
import numpy as np
import copy
import json
import os
import importlib
import transformers
from typing import List, Union
from pathlib import Path
from .blender_utils import (
load_ranker,
load_other_ranker,
load_fuser,
RankerDataset,
GenFuserDataset,
get_topk_candida... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | data/reward_bench/prepare.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:13.751622 | import fire
import datasets
import json
import random
from typing import List
def get_pair_from_conv_for_single_turn(convAs: List[str], convBs: List[str]):
"""Compare two conversations by takeing USER turns as inputs and ASSISTANT turns as candidates
Multi-turn conversations comparison is also supportted.
... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/candidates_generation/generate_candidates.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:13.770198 | # Generate summary candidates with the fine-tuned models.
import argparse
import sys
import os
import torch
import logging
from tqdm import tqdm
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from engine import (
beam_search_step,
)
from common.utils import (
seed_everything,
... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/gen_fuser/config.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:14.644876 | from dataclasses import dataclass, field
from dataclasses_json import dataclass_json
@dataclass_json
@dataclass
class GenFuserConfig:
model_name:str = field(default="llm-blender/gen_fuser_3b",
metadata={"help": "Model name from huggingface.co/models"}
)
cache_dir:str = field(default=None,
me... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/common/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:14.646141 | import random
import os
import numpy as np
import torch
import argparse
import hashlib
import json
import prettytable as pt
import tabulate
from collections import defaultdict
from typing import List, Dict
def seed_everything(seed=42):
random.seed(seed)
os.environ['PYTHONHASHSEED'] = str(seed)
np.random.see... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/common/bart_score.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:14.647483 | import torch
import torch.nn as nn
import traceback
from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig
from typing import List
import numpy as np
class BARTScorer:
def __init__(self, device='cuda:0', max_length=1024, checkpoint='facebook/bart-large-cnn'):
# Set up model
... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/download_dataset/get_mixinstruct.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:14.649230 | # Description: Download datasets GPT4all, Dolly 15k, ITwGPT4, ShareGPT
import json
import os
import random
from transformers import AutoTokenizer
from datasets import load_dataset
from tqdm import tqdm
from pathlib import Path
dev_num = 5000
test_num = 5000
train_num = 100000
DATA_DIR = Path("../../data")
DATA_DIR.mkd... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/common/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:14.650646 | import os
import sys
cur_folder= os.path.dirname(os.path.abspath(__file__))
if cur_folder not in sys.path:
sys.path.append(cur_folder)
|
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/candidates_generation/model_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:14.866607 | from transformers import (
AutoTokenizer,
AutoModelForSeq2SeqLM,
AutoModelForCausalLM,
AutoModel,
)
import torch
decoder_only_models = ["alpaca", "llama", "vicuna", "dolly", "oasst", "stablelm", "koala", "baize", "moss", "opt", "mpt", "guanaco", "hermes", "wizardlm", "airoboros"]
non_conv_models = [... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/download_dataset/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:15.399675 | import hashlib
import argparse
def generate_hash_code(text):
# Convert the text to bytes and create a hash object
hash_object = hashlib.sha256(text.encode())
# Get the hexadecimal representation of the hash code
hex_code = hash_object.hexdigest()
# Return the first 16 digits of the hexadecimal c... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/common/evaluation.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:15.511534 |
import psutil
import os
import numpy as np
import spacy
import bert_score
import torch
import gc
from copy import deepcopy
from evaluate import load
from sacrebleu import sentence_bleu, corpus_bleu
from nltk import word_tokenize
from typing import List, Optional, Union, Dict, Tuple
from absl import logging
from torch ... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/gen_fuser/fuse_infer.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:15.530629 | import argparse
from model_utils import EncDecModelManager
import json
from tqdm import tqdm
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--model_type', default="seq2seq", type=str, help='seq2seq or clm')
parser.add_argument('--model_path', default="yuchenlin/gen_fuser", t... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/gpt_eval/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:16.046889 | import numpy as np
from pathlib import Path
from itertools import combinations
def get_ranks_from_cmps(cmp_results, policy="max_logits"):
"""
Args:
cmp_results: ndarray of shape (n, c, c) where n is the number of samples, c is the number of candidates
for each element, >0 means the first ca... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/collator.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:16.159046 | import torch
def encode_texts(texts, tokenizer, max_length=None):
"""
Args:
texts List[str]: [n_texts]
Returns:
input_ids: [n_texts, max_length]
attention_mask: [n_texts, max_length]
"""
p = tokenizer.batch_encode_plus(
texts,
max_length=max_length,
p... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/config.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:16.193497 | from dataclasses import dataclass, field
from dataclasses_json import dataclass_json
@dataclass_json
@dataclass
class RankerConfig:
ranker_type:str = field(
default=None,
metadata={"help": "Ranker type, pairranker or reranker \
choices: summareranker, dual, pairranker, other;"},
... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/gen_fuser/model_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:16.601286 | from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, AutoModelForCausalLM
# from transformers import LlamaTokenizer, LlamaForCausalLM
import torch
import os
import json
class ModelManager:
def __init__(self, model_path, model_name):
self.model_path = model_path
self.model_name = model... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/gen_fuser/take_subset.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:16.602411 | import json
import random
import re
# input_file = '../../data/fuse_gen/val/top3_deberta-bartscore-test.jsonl'
# output_file = '../../data/fuse_gen/val/top3_deberta-bartscore-test.mini.jsonl'
# subset_size = 1500
# input_file = '../../data/fuse_gen/train/top3_deberta-bartscore.jsonl'
# output_file = '../../data/fuse_g... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/gen_fuser/ds_train.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:16.603728 | """
Fine-tuning the library models for sequence to sequence.
For now, this supports Zero3 with float32
"""
import wandb
import logging
import os
import sys
from dataclasses import dataclass, field
from typing import Optional
import numpy as np
import transformers
from transformers import (
AutoConfig,
AutoMo... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/gen_fuser/test.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:16.919455 |
from datasets import load_dataset, load_metric
data_files = {}
data_files["train"] = "../../data/fuse_gen/train/top3_deberta-bartscore.clean.jsonl"
data_files["validation"] = "../../data/fuse_gen/val/top3_deberta-bartscore-test.mini.jsonl"
# data_files["test"] = None
print(data_files)
raw_datasets = load_dataset('jso... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/data.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:16.983386 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch
import random
import json
import numpy as np
from ..common.evaluation import METRIC_WEIGHTS
class Dataset(tor... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/model_util.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:17.088683 | import torch
import os
import numpy as np
import torch.nn.functional as F
from .ranker import (
SummaReranker,
DualReranker,
CrossCompareReranker,
)
from .collator import (
DualCollator,
SCRCollator,
CrossCompareCollator,
DebertaRMCollator,
StarlingRMCollator,
UltraRMCollator
)
from ... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/other_rms/ultra_rm.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:17.190151 | from transformers import PreTrainedModel, LlamaConfig, LlamaModel, LlamaTokenizer
import torch.nn as nn
import torch
from typing import Optional, List
class UltraRM(PreTrainedModel):
config_class = LlamaConfig
def __init__(self, config):
super().__init__(config)
self.model = LlamaModel(config)
... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/other_rms/starling_rm.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:17.219846 | import os
import torch
from torch import nn
from transformers import AutoModelForCausalLM, AutoTokenizer
from huggingface_hub import snapshot_download
## Define the reward model function class
class StarlingRM(nn.Module):
def __init__(self, pretrained_model, config, tokenizer):
super().__init__()
... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/pairrm.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:18.027215 | import torch
import torch.nn as nn
from transformers.models.deberta_v2.modeling_deberta_v2 import (
DebertaV2PreTrainedModel,
DebertaV2Model,
SequenceClassifierOutput
)
from typing import Optional, Tuple, Union
class DebertaV2PairRM(DebertaV2PreTrainedModel):
def __init__(self, config):
su... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/trainer.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:18.207762 | import torch
import torch.nn as nn
import numpy as np
import os
import wandb
import logging
import json
from transformers.trainer import Trainer
from transformers.trainer_seq2seq import Seq2SeqTrainer
from transformers import EvalPrediction
from typing import Dict, List, Optional, Tuple, Union, Any
from torch.utils.dat... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/layers.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:18.238127 | import torch
import torch.nn as nn
from .model_moe import MoE
class ModelMultitaskRegression(nn.Module):
"""
This class is used to train the model for the multitask regression task.
Use as a layer return the loss
"""
def __init__(self, n_tasks, input_size, hidden_size):
super(ModelM... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | train_ranker.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:18.349763 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import os
import argparse
import torch
import transformers
import numpy as np
import wandb
import os
import pprint
import w... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/loss.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:18.389163 | import torch
import torch.nn as nn
import numpy as np
PADDED_Y_VALUE = -1
PADDED_INDEX_VALUE = -1
DEFAULT_EPS = 1e-10
def permutation_prob(scores, level=1):
"""
Args:
scores: [batch_size, n_candidates]
level: level of the permutation probs to compute
when level is positive, we com... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:18.399862 | from setuptools import setup, find_packages
# read the contents of your README file
from pathlib import Path
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()
setup(
name='llm_blender',
version='0.0.2',
description='LLM-Blender, an innovative ensembling fr... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/ranker.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:18.889696 | import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from .layers import (
MoE,
)
from .loss import (
simcls_loss,
)
class SummaReranker(nn.Module):
"""
Sequence Classification Reranker
Input format:
[CLS] Source: <source> [SEP] Candidate: <can... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/gpt_eval/cor_eval.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:21.390537 | import json
import numpy as np
import scipy
def cor_pearson(hypo_ranks, ref_ranks):
"""
Args:
hypo_ranks: ndarray of shape (n, c) where n is the number of samples, c is the number of candidates
ref_ranks: ndarray of shape (n, c) where n is the number of samples, c is the number of candidates
... |
yuchenlin/LLM-Blender | https://github.com/yuchenlin/LLM-Blender | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | llm_blender/pair_ranker/model_moe.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:21.769931 | # Most of this file is taken from https://github.com/davidmrau/mixture-of-experts
# We thank the authors for sharing their code.
import torch
import torch.nn as nn
import numpy as np
from torch.distributions.normal import Normal
class MoE(nn.Module):
"""Call a Sparsely gated mixture of experts layer with 1-lay... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/exc.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:23.961761 | """
Exceptions & Error Handling
============================
Exceptions and error handling for stravalib.
These are classes designed to capture and handle various errors encountered when interacting with the Strava API.
"""
from __future__ import annotations
import logging
import warnings
import requests.exceptions
... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | noxfile.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:23.976932 | import os
import pathlib
import shutil
from glob import glob
import nox
nox.options.default_venv_backend = "uv"
nox.options.reuse_existing_virtualenvs = False
# Sphinx output and source directories
BUILD_DIR = "_build"
OUTPUT_DIR = pathlib.Path(BUILD_DIR, "html")
SOURCE_DIR = pathlib.Path("docs")
# Sphinx build com... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:23.986027 | import os.path
# Removing unittest - exception for python < 3.0 as we no longer support it
from unittest import TestCase
TESTS_DIR = os.path.dirname(__file__)
RESOURCES_DIR = os.path.join(TESTS_DIR, "resources")
class TestBase(TestCase):
def setUp(self):
super().setUp()
def tearDown(self):
... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/protocol.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:23.988636 | """Protocol
==============
Low-level classes for interacting directly with the Strava API webservers.
"""
from __future__ import annotations
import abc
import functools
import logging
import os
import time
from collections.abc import Callable
from typing import TYPE_CHECKING, Any, Literal, TypedDict
from urllib.parse... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | docs/conf.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:23.993948 | #
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
import datetime
# I... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/strava-oauth/server.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:23.996527 | #!flask/bin/python
from flask import Flask, render_template, request, url_for
from stravalib import Client
app = Flask(__name__)
app.config.from_envvar("APP_SETTINGS")
@app.route("/")
def login():
c = Client()
url = c.authorization_url(
client_id=app.config["STRAVA_CLIENT_ID"],
redirect_uri=... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/model.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:23.997919 | """
==============================
Model Functions and Classes
==============================
This module contains entity classes that represent the various Strava
datatypes, such as `Activity`, `Gear`, and more. These entities inherit
fields from superclasses in `strava_model.py`, which is generated from
the official ... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:24.000414 | from stravalib.client import Client
__all__ = ["Client"]
try:
from ._version_generated import __version__
except ImportError:
__version__ = "unreleased"
|
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/client.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:24.030524 | """
Client
==============
Provides the main interface classes for the Strava version 3 REST API.
"""
from __future__ import annotations
import calendar
import collections
import functools
import logging
import time
from collections.abc import Iterable
from datetime import datetime, timedelta, timezone
from io import ... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/unit/test_model.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:25.518150 | from datetime import datetime, timedelta, timezone
from zoneinfo import ZoneInfo
import pytest
import stravalib.unit_helper as uh
from stravalib import model
from stravalib.model import (
ActivityPhoto,
ActivityTotals,
AthletePrEffort,
AthleteSegmentStats,
AthleteStats,
BaseEffort,
Detaile... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/conftest.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:25.518699 | import os
import warnings
from unittest.mock import patch
import pytest
from stravalib import Client
from stravalib.protocol import ApiV3
from stravalib.tests.integration.strava_api_stub import StravaAPIMock
warnings.simplefilter("always")
@pytest.fixture
def mock_strava_api():
with StravaAPIMock() as api_mock... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/auth_responder.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:25.519780 | #!/usr/bin/env python
"""
A basic authorization server. Run this with your Strava Client ID and Client Secret and access from your
browser (because the Strava OAuth page uses javascript) in order to get a resulting access token. That access
token can then be used to initialize a Client that can read (and/or write) da... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/integration/strava_api_stub.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:25.522076 | import json
import logging
import os
import re
from functools import lru_cache, wraps
from typing import Any, Callable, Optional
import requests
from responses import BaseResponse, RequestsMock
from stravalib.protocol import ApiV3
from stravalib.tests import RESOURCES_DIR
LOGGER = logging.getLogger(__name__)
@lru_... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/unit/test_limiter.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:25.523582 | import arrow
import pytest
from stravalib.util.limiter import (
RequestRate,
SleepingRateLimitRule,
get_rates_from_response_headers,
get_seconds_until_next_day,
get_seconds_until_next_quarter,
)
# Example responses for Strava 3rd party apps that are not enrolled in the
# 2023 developer program:
f... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/integration/test_client.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:25.524840 | import datetime
import json
import os
import warnings
from unittest import mock
from unittest.mock import patch
import pytest
import responses
from responses import matchers
from stravalib.client import ActivityUploader
from stravalib.exc import (
AccessUnauthorized,
ActivityPhotoUploadFailed,
)
from stravali... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/unit/test_client_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:26.179276 | import datetime
import os
from datetime import timezone
from unittest import mock
from urllib import parse as urlparse
from stravalib.client import Client
from stravalib.tests import RESOURCES_DIR, TestBase
class ClientUtilsTest(TestBase):
client = Client()
def test_utc_datetime_to_epoch_utc_datetime_given_... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/unit/test_client.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:26.804148 | import stravalib
def test_client_protocol_initialization():
"""Test that instantiating Client sets corresponding values in protocol."""
client = stravalib.Client(
access_token="access_123",
token_expires=123456,
refresh_token="refresh_123",
)
assert client.protocol.access_toke... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/unit/test_protocol_auth.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:27.595240 | from unittest.mock import patch
import pytest
from stravalib.protocol import ApiV3
@pytest.fixture
def mock_token_exchange_response():
"""A fixture that mocks a token exchange response that includes
the athlete info"""
return {
"access_token": "mock_access_token",
"refresh_token": "mock_... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/unit/test_protocol_ApiV3_token_refresh.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:27.597190 | import logging
import os
import time
from unittest.mock import MagicMock, patch
import pytest
import stravalib
###### _request method responsible for API call ######
@pytest.mark.parametrize(
"url, should_call_refresh",
[
("/oauth/token", False), # Skips refreshing for /oauth/token
(
... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/unit_helper.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:27.597902 | """
Unit Helper
==============
Helpers for converting Strava's units to something more practical.
"""
from typing import Any
import pint
from pint.facets.plain import PlainQuantity
from stravalib.unit_registry import ureg
class _Quantity(float):
"""
Subtype of float that can represent quantities by adding ... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/tests/unit/test_unithelper.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:27.598347 | import pytest
from stravalib import unit_helper as uh
from stravalib.unit_helper import _Quantity
class DistanceQuantity(_Quantity):
unit = "feet"
@pytest.mark.parametrize(
"expression,expected_unitless_result",
((uh.ureg("feet") * 6, 1.83), (DistanceQuantity(6), 1.83), (2.0, 2.0)),
)
def test_unit_con... |
stravalib/stravalib | https://github.com/stravalib/stravalib | null | null | null | null | 980 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/stravalib/util/limiter.py | null | null | null | null | null | null | Python | 2026-05-04T02:34:28.075825 | """Utilities
==============
Rate limiter classes.
These are basically callables that when called register that a request was
issued. Depending on how they are configured that may cause a pause or
exception if a rate limit has been exceeded. It is up to the calling
code to ensure that these callables are invoked with e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.