repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tools/merge_lora_weights_to_model.py
tools/merge_lora_weights_to_model.py
from swift.llm import merge_lora_main if __name__ == '__main__': merge_lora_main(replace_if_exists=True)
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/utils.py
logits-processor-zoo/logits_processor_zoo/utils.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/vllm/trigger_phrase.py
logits-processor-zoo/logits_processor_zoo/vllm/trigger_phrase.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/vllm/myprocessor1.py
logits-processor-zoo/logits_processor_zoo/vllm/myprocessor1.py
import torch import math from transformers import AutoTokenizer, AutoModelForCausalLM, LogitsProcessor, LogitsProcessorList import os import torch from PIL import Image from tqdm import tqdm from vllm import LLM, SamplingParams import torch from transformers import LogitsProcessor import math import torch from tra...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/vllm/last_phrase.py
logits-processor-zoo/logits_processor_zoo/vllm/last_phrase.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/vllm/generation_length.py
logits-processor-zoo/logits_processor_zoo/vllm/generation_length.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/vllm/myprocessor.py
logits-processor-zoo/logits_processor_zoo/vllm/myprocessor.py
import torch import math from transformers import AutoTokenizer, AutoModelForCausalLM, LogitsProcessor, LogitsProcessorList import os import torch from PIL import Image from tqdm import tqdm from vllm import LLM, SamplingParams import torch from transformers import LogitsProcessor import math import torch from tra...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/vllm/__init__.py
logits-processor-zoo/logits_processor_zoo/vllm/__init__.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/vllm/multiple_choice.py
logits-processor-zoo/logits_processor_zoo/vllm/multiple_choice.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/vllm/cite_prompt.py
logits-processor-zoo/logits_processor_zoo/vllm/cite_prompt.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/trtllm/last_phrase.py
logits-processor-zoo/logits_processor_zoo/trtllm/last_phrase.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/trtllm/generation_length.py
logits-processor-zoo/logits_processor_zoo/trtllm/generation_length.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/trtllm/__init__.py
logits-processor-zoo/logits_processor_zoo/trtllm/__init__.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/trtllm/multiple_choice.py
logits-processor-zoo/logits_processor_zoo/trtllm/multiple_choice.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/logits_processor_zoo/trtllm/cite_prompt.py
logits-processor-zoo/logits_processor_zoo/trtllm/cite_prompt.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/tests/test_utils.py
logits-processor-zoo/tests/test_utils.py
from logits_processor_zoo.utils import text_to_token, get_new_line_tokens, enforce_tokens import torch def test_text_to_token(llm_runner): assert text_to_token(llm_runner.tokenizer, ",", last=False) == 1919 assert text_to_token(llm_runner.tokenizer, "apple, orange,", last=True) == 29892 assert text_to_tok...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/tests/conftest.py
logits-processor-zoo/tests/conftest.py
# # SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/example_notebooks/vllm/utils.py
logits-processor-zoo/example_notebooks/vllm/utils.py
import os import vllm # vLLM V1 does not currently accept logits processor so we need to disable it # https://docs.vllm.ai/en/latest/getting_started/v1_user_guide.html#deprecated-features os.environ["VLLM_USE_V1"] = "0" class vLLMRunner: def __init__(self, model_name="Qwen/Qwen2.5-1.5B-Instruct"): self.m...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/example_notebooks/trtllm/last_phrase_logits_processor.py
logits-processor-zoo/example_notebooks/trtllm/last_phrase_logits_processor.py
from transformers import AutoTokenizer from logits_processor_zoo.trtllm import ForceLastPhraseLogitsProcessor from utils import TRTLLMTester, get_parser if __name__ == "__main__": args = get_parser() beam_width = 1 tokenizer = AutoTokenizer.from_pretrained(args.tokenizer_path) phrase = "\n\nThanks f...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/example_notebooks/trtllm/utils.py
logits-processor-zoo/example_notebooks/trtllm/utils.py
import argparse import datetime from typing import List import tensorrt_llm.bindings.executor as trtllm # TensorRT-LLM utility functions are taken from: # https://github.com/NVIDIA/TensorRT-LLM/blob/main/examples/bindings/executor/example_logits_processor.py # Prepare and enqueue the requests class TRTLLMTester: ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/example_notebooks/trtllm/gen_length_logits_processor.py
logits-processor-zoo/example_notebooks/trtllm/gen_length_logits_processor.py
from transformers import AutoTokenizer from logits_processor_zoo.trtllm import GenLengthLogitsProcessor from utils import TRTLLMTester, get_parser if __name__ == "__main__": args = get_parser() beam_width = 1 tokenizer = AutoTokenizer.from_pretrained(args.tokenizer_path) lp = GenLengthLogitsProcesso...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/example_notebooks/trtllm/multiple_choice_logits_processor.py
logits-processor-zoo/example_notebooks/trtllm/multiple_choice_logits_processor.py
from transformers import AutoTokenizer from logits_processor_zoo.trtllm import MultipleChoiceLogitsProcessor from utils import TRTLLMTester, get_parser if __name__ == "__main__": args = get_parser() beam_width = 1 tokenizer = AutoTokenizer.from_pretrained(args.tokenizer_path) lp = MultipleChoiceLogi...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/logits-processor-zoo/example_notebooks/trtllm/cite_prompt_logits_processor.py
logits-processor-zoo/example_notebooks/trtllm/cite_prompt_logits_processor.py
from transformers import AutoTokenizer from logits_processor_zoo.trtllm import CiteFromPromptLogitsProcessor from utils import TRTLLMTester, get_parser if __name__ == "__main__": args = get_parser() beam_width = 1 tokenizer = AutoTokenizer.from_pretrained(args.tokenizer_path) lp = CiteFromPromptLogi...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/run.py
tests/run.py
#!/usr/bin/env python # Copyright (c) Alibaba, Inc. and its affiliates. import argparse import datetime import math import os import subprocess import sys sys.path.insert(0, '/swift') import tempfile import time import unittest from fnmatch import fnmatch from pathlib import Path from unittest import TextTestResult i...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/test_utils.py
tests/test_utils.py
#!/usr/bin/env python # Copyright (c) Alibaba, Inc. and its affiliates. import copy import os import pickle import shutil import socket import subprocess import sys import tarfile import tempfile import unittest from collections import OrderedDict from collections.abc import Mapping from os.path import expanduser imp...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/model_tag.py
tests/model_tag.py
# Copyright (c) Alibaba, Inc. and its affiliates. import logging import os import json import requests from swift.version import __version__ # 打标 class ModelTag(object): _URL = os.environ.get('MODEL_TAG_URL', None) # 模型测试结果 BATCH_COMMIT_RESULT_URL = f'{_URL}/batchCommitResult' # 测试阶段完成 BATCH_R...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/__init__.py
tests/__init__.py
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/custom/test_vllm.py
tests/custom/test_vllm.py
def test_vllm(): import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' from swift.llm import (ModelType, get_vllm_engine, get_default_template_type, get_template, inference_vllm, inference_stream_vllm) model_type = ModelType.qwen_7b_chat llm_engine = get_vllm_engine(model_t...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/custom/test_lmdeploy_vlm.py
tests/custom/test_lmdeploy_vlm.py
def test_lmdeploy_vlm(): import os os.environ['CUDA_VISIBLE_DEVICES'] = '1' from swift.llm import (ModelType, get_lmdeploy_engine, get_default_template_type, get_template, inference_lmdeploy, inference_stream_lmdeploy) model_type = ModelType.deepseek_vl_1_3b_chat lmdeplo...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/custom/test_vllm_vlm.py
tests/custom/test_vllm_vlm.py
def test_vllm_vlm(): import os import vllm from packaging import version os.environ['CUDA_VISIBLE_DEVICES'] = '0' assert version.parse(vllm.__version__) >= version.parse('0.5.1') from swift.llm import (ModelType, get_vllm_engine, get_default_template_type, get_template, inference_vllm, ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/custom/test_pt_vlm.py
tests/custom/test_pt_vlm.py
def test_pt_vlm(): import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' from swift.llm import (ModelType, get_model_tokenizer, get_default_template_type, get_template, inference, inference_stream) model_type = ModelType.internvl2_2b model, tokenizer = get_model_tokenizer(mo...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/custom/test_lmdeploy.py
tests/custom/test_lmdeploy.py
def test_lmdeploy(): import os os.environ['CUDA_VISIBLE_DEVICES'] = '1' from swift.llm import (ModelType, get_lmdeploy_engine, get_default_template_type, get_template, inference_lmdeploy, inference_stream_lmdeploy) model_type = ModelType.qwen_7b_chat lmdeploy_engine = ge...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/custom/test_main.py
tests/custom/test_main.py
import os def test_eval_llm(): os.environ['CUDA_VISIBLE_DEVICES'] = '0' from swift.llm import eval_main, EvalArguments eval_main(EvalArguments(model_type='qwen1half-7b-chat', eval_dataset='ARC_c', infer_backend='lmdeploy')) def test_eval_vlm(): os.environ['CUDA_VISIBLE_DEVICES'] = '1' from swift...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/custom/test_logprobs.py
tests/custom/test_logprobs.py
def _test_client(print_logprobs: bool = False): import requests import time from pprint import pprint from swift.llm import get_model_list_client, XRequestConfig, inference_client query = '123*234=?' while True: try: model_list = get_model_list_client() except reques...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/custom/test_megatron.py
tests/custom/test_megatron.py
import os from swift.llm import ExportArguments, InferArguments, SftArguments, export_main, infer_main, sft_main model_type = 'qwen1half-7b-chat' tp = 2 def convert2megatron(): os.environ['CUDA_VISIBLE_DEVICES'] = '0' export_main(ExportArguments(model_type=model_type, to_megatron=True, tp=tp, dtype='bf16'))...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/tuners/test_rome.py
tests/tuners/test_rome.py
import os import shutil import tempfile import unittest import torch from modelscope import AutoTokenizer, Model from swift import Swift from swift.tuners.rome import RomeConfig class TestRome(unittest.TestCase): def setUp(self): print(('Testing %s.%s' % (type(self).__name__, self._testMethodName))) ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/tuners/test_peft.py
tests/tuners/test_peft.py
import copy import os import shutil import tempfile import unittest import peft import torch from modelscope import Preprocessor from modelscope.models.nlp.structbert import SbertConfig, SbertForSequenceClassification from peft import PeftModel, inject_adapter_in_model from peft.config import PeftConfigMixin from peft...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/tuners/test_scetuning.py
tests/tuners/test_scetuning.py
import copy import os import shutil import tempfile import unittest import torch from modelscope import snapshot_download from swift import SCETuningConfig, Swift from swift.tuners.part import PartConfig class TestSCETuning(unittest.TestCase): def setUp(self): print(('Testing %s.%s' % (type(self).__nam...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/tuners/test_merged_linear.py
tests/tuners/test_merged_linear.py
import math import unittest import torch from modelscope import Model, Preprocessor from torch import nn from swift import LoRAConfig, Swift class TestMergedLinear(unittest.TestCase): def test_swift_lora_forward(self): from swift.tuners.lora import MergedLinear def reset_parameters(self): ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/tuners/test_swift_restuning.py
tests/tuners/test_swift_restuning.py
import copy import os import shutil import tempfile import unittest import torch from modelscope import snapshot_download from swift import ResTuningConfig, Swift, SwiftModel class TestSwiftResTuning(unittest.TestCase): def setUp(self): print(('Testing %s.%s' % (type(self).__name__, self._testMethodNam...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/tuners/__init__.py
tests/tuners/__init__.py
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/tuners/test_neft.py
tests/tuners/test_neft.py
import os import shutil import tempfile import unittest import torch from modelscope import AutoModel, Preprocessor from peft.utils import WEIGHTS_NAME from transformers import PreTrainedModel from swift import LoRAConfig, Swift from swift.tuners import NEFTuneConfig class TestNEFT(unittest.TestCase): def setU...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/tuners/test_swift_base.py
tests/tuners/test_swift_base.py
import copy import math import os import re import shutil import tempfile import unittest from concurrent.futures import ThreadPoolExecutor import peft import torch from modelscope import Model, Preprocessor from modelscope.models.nlp.structbert import SbertConfig, SbertForSequenceClassification from peft import PeftM...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/tuners/test_swift_device_map.py
tests/tuners/test_swift_device_map.py
import os import shutil import tempfile import unittest import torch from modelscope import Model from peft.utils import WEIGHTS_NAME from swift import LoRAConfig, SwiftModel @unittest.skip class TestSwift(unittest.TestCase): def setUp(self): print(('Testing %s.%s' % (type(self).__name__, self._testMet...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/tuners/test_extra_state_dict.py
tests/tuners/test_extra_state_dict.py
import os.path import shutil import tempfile import unittest import torch from modelscope import Model from swift import LoRAConfig, Swift from swift.tuners.utils import ModulesToSaveWrapper class TestExtraStateDict(unittest.TestCase): def setUp(self): print(('Testing %s.%s' % (type(self).__name__, sel...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/utils/test_io_utils.py
tests/utils/test_io_utils.py
import os import shutil import tempfile import unittest from swift.utils import append_to_jsonl, get_logger, read_from_jsonl, write_to_jsonl logger = get_logger() class TestIOUtils(unittest.TestCase): def setUp(self): self._tmp_dir = tempfile.TemporaryDirectory() self.tmp_dir = self._tmp_dir.na...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/utils/test_torch_utils.py
tests/utils/test_torch_utils.py
import unittest from modelscope import Model from swift.utils.torch_utils import find_sub_module class TestTorchUtils(unittest.TestCase): def test_find_sub_module(self): model = Model.from_pretrained('damo/nlp_structbert_sentence-similarity_chinese-base') self.assertTrue(find_sub_module(model, ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/utils/__init__.py
tests/utils/__init__.py
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/llm/test_run2.py
tests/llm/test_run2.py
if __name__ == '__main__': import os os.environ['CUDA_VISIBLE_DEVICES'] = '1' os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com' import os import shutil import tempfile import unittest import torch from swift import get_logger from swift.llm import DatasetName, InferArguments, ModelType, SftArguments, i...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/llm/test_run.py
tests/llm/test_run.py
if __name__ == '__main__': import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com' import os import shutil import tempfile import time import unittest from functools import partial from typing import Any, Dict, List import torch import transformers from datas...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/llm/test_utils.py
tests/llm/test_utils.py
import os import unittest from swift.llm import (ModelType, get_default_template_type, get_model_tokenizer, get_template, inference, inference_stream, limit_history_length, print_example) from swift.utils import lower_bound, seed_everything class TestLlmUtils(unittest.TestCase): def test_...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/llm/test_ollama_export.py
tests/llm/test_ollama_export.py
import os import shutil import tempfile import unittest import transformers from packaging import version from swift.llm import ExportArguments, export_main if __name__ == '__main__': os.environ['CUDA_VISIBLE_DEVICES'] = '0' class TestTemplate(unittest.TestCase): def setUp(self): print(('Testing %...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/llm/test_template.py
tests/llm/test_template.py
import unittest import json import torch from modelscope import GenerationConfig from swift.llm import (TEMPLATE_MAPPING, ModelType, Template, get_default_template_type, get_model_tokenizer, get_template, inference, messages_to_history) if __name__ == '__main__': import os os.environ['...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/llm/__init__.py
tests/llm/__init__.py
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/llm/test_vllm_utils.py
tests/llm/test_vllm_utils.py
import os import unittest import torch from swift.llm.utils import * from swift.utils import lower_bound, seed_everything SKPT_TEST = True class TestVllmUtils(unittest.TestCase): @unittest.skipIf(SKPT_TEST, 'To avoid citest error: OOM') def test_inference_vllm(self): model_type = ModelType.qwen_7b...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/llm/test_dataset.py
tests/llm/test_dataset.py
import tempfile import unittest from datasets import Dataset as HfDataset from swift.llm import DatasetName, get_dataset class TestDataset(unittest.TestCase): def test_load_v_dataset(self): if not __name__ == '__main__': # ignore citest error in github return for ds in ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/hub/__init__.py
tests/hub/__init__.py
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/tests/hub/test_check_model.py
tests/hub/test_check_model.py
import os import shutil import tempfile import unittest from modelscope import Model from swift.hub.check_model import check_local_model_is_latest class TestCheckModel(unittest.TestCase): def setUp(self): print(('Testing %s.%s' % (type(self).__name__, self._testMethodName))) self.tmp_dir = temp...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/transform_vision_model_config.py
Baselines_AIGI/transform_vision_model_config.py
""" Enhanced transform_vision_model.py with configuration file support. Replaces the vision model in LLaVA with a trained visual encoder. """ import os import argparse from config_loader import ConfigLoader, create_argument_parser, load_config_from_args from transformers import CLIPVisionModel, CLIPImageProcessor, Lla...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/util.py
Baselines_AIGI/util.py
import sys import os import torch def mkdirs(paths): if isinstance(paths, list) and not isinstance(paths, str): for path in paths: mkdir(path) else: mkdir(paths) def mkdir(path): if not os.path.exists(path): os.makedirs(path) def unnormalize(tens, mean=[0.485, 0.456...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models.py
Baselines_AIGI/models.py
import torch import torch.nn as nn import clip class Hook: def __init__(self, name, module): self.name = name self.hook = module.register_forward_hook(self.hook_fn) def hook_fn(self, module, input, output): self.input = input self.output = output def close(self): ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/validate.py
Baselines_AIGI/validate.py
import torch import numpy as np from networks.resnet import resnet50 from sklearn.metrics import average_precision_score, precision_recall_curve, accuracy_score from options.test_options import TestOptions from data import create_dataloader def validate(model, opt): data_loader = create_dataloader(opt) with ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/test_huggingface.py
Baselines_AIGI/test_huggingface.py
import os import sys import time import torch import torch.nn import argparse from PIL import Image import torch.nn as nn from tensorboardX import SummaryWriter import numpy as np from validate import validate, validate4huggingface from data import create_dataloader from networks.trainer import Trainer from options.tra...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/config_loader.py
Baselines_AIGI/config_loader.py
""" Configuration loader for AIGC Detection project. Loads configuration from YAML files and provides easy access to parameters. """ import yaml import os import argparse from typing import Dict, Any, Optional from pathlib import Path class ConfigLoader: """ Configuration loader that handles YAML configurati...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/train_with_config.py
Baselines_AIGI/train_with_config.py
""" Unified training script with configuration support. Supports visual pretraining and automatic model conversion. """ import os import sys import time import torch import torch.nn import argparse from PIL import Image from tensorboardX import SummaryWriter import numpy as np from validate import validate from data i...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/convert_weight2hf_config.py
Baselines_AIGI/convert_weight2hf_config.py
""" Enhanced convert_weight2hf.py with configuration file support. Converts trained models to HuggingFace format for easy deployment and sharing. """ import os import sys import time import torch import torch.nn import argparse from PIL import Image from tensorboardX import SummaryWriter import numpy as np from valida...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/options/test_options.py
Baselines_AIGI/options/test_options.py
from .base_options import BaseOptions class TestOptions(BaseOptions): def initialize(self, parser): parser = BaseOptions.initialize(self, parser) # parser.add_argument('--dataroot') parser.add_argument('--model_path') parser.add_argument('--no_resize', action='store_true') ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/options/base_options.py
Baselines_AIGI/options/base_options.py
import argparse import os import time import util import torch #import models #import data class BaseOptions(): def __init__(self): self.initialized = False def initialize(self, parser): parser.add_argument('--mode', default='binary') parser.add_argument('--arch', type=str, default='...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/options/__init__.py
Baselines_AIGI/options/__init__.py
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/options/train_options.py
Baselines_AIGI/options/train_options.py
from .base_options import BaseOptions class TrainOptions(BaseOptions): def initialize(self, parser): parser = BaseOptions.initialize(self, parser) parser.add_argument('--earlystop_epoch', type=int, default=15) parser.add_argument('--data_aug', action='store_true', help='if specified, perf...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/vision_transformer_utils.py
Baselines_AIGI/models/vision_transformer_utils.py
import math import pathlib import warnings from types import FunctionType from typing import Any, BinaryIO, List, Optional, Tuple, Union import numpy as np import torch from PIL import Image, ImageColor, ImageDraw, ImageFont __all__ = [ "make_grid", "save_image", "draw_bounding_boxes", "draw_segmentat...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/vgg.py
Baselines_AIGI/models/vgg.py
import torch import torch.nn as nn from typing import Union, List, Dict, Any, cast import torchvision import torch.nn.functional as F class VGG(torch.nn.Module): def __init__(self, arch_type, pretrained, progress): super().__init__() self.layer1 = torch.nn.Sequential() self.lay...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/vision_transformer.py
Baselines_AIGI/models/vision_transformer.py
import math from collections import OrderedDict from functools import partial from typing import Any, Callable, List, NamedTuple, Optional import torch import torch.nn as nn # from .._internally_replaced_utils import load_state_dict_from_url from .vision_transformer_misc import ConvNormActivation from .vision_transfo...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/resnet.py
Baselines_AIGI/models/resnet.py
import torch from torch import Tensor import torch.nn as nn from typing import Type, Any, Callable, Union, List, Optional try: from torch.hub import load_state_dict_from_url except ImportError: from torch.utils.model_zoo import load_url as load_state_dict_from_url model_urls = { 'resnet18': 'https://down...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/imagenet_models.py
Baselines_AIGI/models/imagenet_models.py
from .resnet import resnet18, resnet34, resnet50, resnet101, resnet152 from .vision_transformer import vit_b_16, vit_b_32, vit_l_16, vit_l_32 from torchvision import transforms from PIL import Image import torch import torch.nn as nn model_dict = { 'resnet18': resnet18, 'resnet34': resnet34, 'resnet50'...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/vision_transformer_misc.py
Baselines_AIGI/models/vision_transformer_misc.py
from typing import Callable, List, Optional import torch from torch import Tensor from .vision_transformer_utils import _log_api_usage_once interpolate = torch.nn.functional.interpolate # This is not in nn class FrozenBatchNorm2d(torch.nn.Module): """ BatchNorm2d where the batch statistics and the affine ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/clip_models.py
Baselines_AIGI/models/clip_models.py
from .clip import clip from PIL import Image import torch.nn as nn CHANNELS = { "RN50" : 1024, "ViT-L/14" : 768, "ViT-L/14@336px" : 768 } class CLIPModel(nn.Module): def __init__(self, name, num_classes=1, opt=None): super(CLIPModel, self).__init__() self.model, self.preprocess = c...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/__init__.py
Baselines_AIGI/models/__init__.py
from .clip_models import CLIPModel from .imagenet_models import ImagenetModel VALID_NAMES = [ 'Imagenet:resnet18', 'Imagenet:resnet34', 'Imagenet:resnet50', 'Imagenet:resnet101', 'Imagenet:resnet152', 'Imagenet:vgg11', 'Imagenet:vgg19', 'Imagenet:swin-b', 'Imagenet:swin-s', 'Im...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/clip/model.py
Baselines_AIGI/models/clip/model.py
from collections import OrderedDict from typing import Tuple, Union import numpy as np import torch import torch.nn.functional as F from torch import nn import loratorch import math class Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1): super().__init__() ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/clip/simple_tokenizer.py
Baselines_AIGI/models/clip/simple_tokenizer.py
import gzip import html import os from functools import lru_cache import ftfy import regex as re @lru_cache() def default_bpe(): return os.path.join(os.path.dirname(os.path.abspath(__file__)), "bpe_simple_vocab_16e6.txt.gz") @lru_cache() def bytes_to_unicode(): """ Returns list of utf-8 byte and a corr...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/clip/__init__.py
Baselines_AIGI/models/clip/__init__.py
from .clip import *
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/clip/clip.py
Baselines_AIGI/models/clip/clip.py
import hashlib import os import urllib import warnings from typing import Any, Union, List from pkg_resources import packaging import torch from PIL import Image from torchvision.transforms import Compose, Resize, CenterCrop, ToTensor, Normalize from tqdm import tqdm from .model import build_model from .simple_tokeni...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/clip/loratorch/utils.py
Baselines_AIGI/models/clip/loratorch/utils.py
# ------------------------------------------------------------------------------------------ # This code is reconstructed based on loralib (https://github.com/microsoft/LoRA) by Baijiong Lin. # ------------------------------------------------------------------------------------------ import torch import torch.nn as ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/clip/loratorch/__init__.py
Baselines_AIGI/models/clip/loratorch/__init__.py
name = "lora" from .layers import * from .utils import *
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/models/clip/loratorch/layers.py
Baselines_AIGI/models/clip/loratorch/layers.py
# ------------------------------------------------------------------------------------------ # This code is reconstructed based on loralib (https://github.com/microsoft/LoRA) by Baijiong Lin. # ------------------------------------------------------------------------------------------ import torch import torch.nn as ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/networks/base_model.py
Baselines_AIGI/networks/base_model.py
# from pix2pix import os import torch import torch.nn as nn from torch.nn import init from torch.optim import lr_scheduler import loratorch class BaseModel(nn.Module): def __init__(self, opt): super(BaseModel, self).__init__() self.opt = opt self.total_steps = 0 self.isTrain = opt....
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/networks/models.py
Baselines_AIGI/networks/models.py
import torch import torch.nn as nn import clip class Hook: def __init__(self, name, module): self.name = name self.hook = module.register_forward_hook(self.hook_fn) def hook_fn(self, module, input, output): self.input = input self.output = output def close(self): ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/networks/resnet.py
Baselines_AIGI/networks/resnet.py
import torch.nn as nn import torch.utils.model_zoo as model_zoo from torch.nn import functional as F from typing import Any, cast, Dict, List, Optional, Union import numpy as np __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152'] model_urls = { 'resnet18': 'https://downl...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/networks/resnet_new.py
Baselines_AIGI/networks/resnet_new.py
import torch.nn as nn import torch.utils.model_zoo as model_zoo __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50_new', 'resnet101', 'resnet152'] model_urls = { 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 'resnet34': 'https://download.pytorch.org/models/resnet34-...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/networks/trainer.py
Baselines_AIGI/networks/trainer.py
import functools import torch import torch.nn as nn from networks.resnet import resnet50 from networks.resnet_new import resnet50_new from networks.models import Model from networks.base_model import BaseModel, init_weights import pdb from models import get_model class Trainer(BaseModel): def name(self): ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/networks/__init__.py
Baselines_AIGI/networks/__init__.py
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/data/datasets.py
Baselines_AIGI/data/datasets.py
import cv2 import numpy as np from albumentations import Downscale, Compose, ImageCompression, GaussNoise, MotionBlur, GaussianBlur from torchvision import transforms, datasets import torchvision.transforms.functional as TF from random import random, choice from io import BytesIO from PIL import Image from PIL import I...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/Baselines_AIGI/data/__init__.py
Baselines_AIGI/data/__init__.py
import torch import numpy as np from torch.utils.data.sampler import WeightedRandomSampler import pdb from .datasets import dataset_folder ''' def get_dataset(opt): dset_lst = [] for cls in opt.classes: root = opt.dataroot + '/' + cls dset = dataset_folder(opt, root) dset_lst.append(ds...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/docs/source_en/conf.py
docs/source_en/conf.py
# 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/docs/source/conf.py
docs/source/conf.py
# 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...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/swift/torchacc_utils.py
swift/torchacc_utils.py
# Copyright (c) Alibaba, Inc. and its affiliates. import os import sys import types from collections import OrderedDict from typing import List, Optional, Tuple import safetensors import torch import torch.nn.functional as F import transformers from packaging import version from peft import PeftModel from torch.utils....
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
true
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/swift/version.py
swift/version.py
# Make sure to modify __release_datetime__ to release time when making official release. __version__ = '2.6.1' # default release datetime for branches under active development is set # to be a time far-far-away-into-the-future __release_datetime__ = '2099-10-13 08:56:12'
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/swift/__init__.py
swift/__init__.py
# Copyright (c) Alibaba, Inc. and its affiliates. from typing import TYPE_CHECKING from .utils.import_utils import _LazyModule if TYPE_CHECKING: from .version import __version__, __release_datetime__ from .tuners import (Adapter, AdapterConfig, AdapterModule, SwiftModel, LoRA, LoRAConfig, SWIFT_MAPPING, ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/swift/aigc/animatediff_infer.py
swift/aigc/animatediff_infer.py
# Copyright (c) Alibaba, Inc. and its affiliates. import os import torch from diffusers import DDIMScheduler, MotionAdapter from diffusers.pipelines import AnimateDiffPipeline from diffusers.utils import export_to_gif from swift import Swift, snapshot_download from swift.aigc.utils import AnimateDiffInferArguments fr...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false
wyczzy/AIGI-Holmes
https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/swift/aigc/animatediff.py
swift/aigc/animatediff.py
import csv import datetime import inspect import logging import os import random import re from copy import deepcopy from types import MethodType from typing import Dict import numpy as np import torch import torch.distributed as dist import torch.nn.functional as F import torchvision import torchvision.transforms as ...
python
Apache-2.0
bae30b9e807230255a9f3fd18c9c64c08805b427
2026-01-05T07:09:55.123229Z
false