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
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/examples/custom-functions/file_upload.py
examples/custom-functions/file_upload.py
""" Example of implementing file upload functionality. This shows how to upload files to file input elements on web pages. """ import asyncio import logging import os import sys import anyio sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from dotenv import load_dotenv...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/examples/custom-functions/action_filters.py
examples/custom-functions/action_filters.py
""" Action filters (domains) let you limit actions available to the Agent on a step-by-step/page-by-page basis. @registry.action(..., domains=['*']) async def some_action(browser_session: BrowserSession): ... This helps prevent the LLM from deciding to use an action that is not compatible with the current page. I...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/examples/custom-functions/parallel_agents.py
examples/custom-functions/parallel_agents.py
""" Simple parallel multi-agent example. This launches multiple agents in parallel to work on different tasks simultaneously. No complex orchestrator - just direct parallel execution. @file purpose: Demonstrates parallel multi-agent execution using asyncio """ import asyncio import os import sys sys.path.append(os....
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/examples/custom-functions/save_to_file_hugging_face.py
examples/custom-functions/save_to_file_hugging_face.py
import asyncio import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from dotenv import load_dotenv load_dotenv() from pydantic import BaseModel from browser_use import ChatOpenAI from browser_use.agent.service import Agent from browser_use.tools.service...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/examples/custom-functions/actor_use.py
examples/custom-functions/actor_use.py
import asyncio import os import sys from browser_use.browser.session import BrowserSession sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from dotenv import load_dotenv load_dotenv() from browser_use import ActionResult, Agent, ChatOpenAI, Tools tools = Tools() llm ...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/examples/custom-functions/2fa.py
examples/custom-functions/2fa.py
import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from dotenv import load_dotenv load_dotenv() from browser_use import Agent secret_key = os.environ.get('OTP_SECRET_KEY') if not secret_key: # For this example copy the code from the website https://...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/examples/custom-functions/advanced_search.py
examples/custom-functions/advanced_search.py
import asyncio import http.client import json import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from dotenv import load_dotenv load_dotenv() import logging from pydantic import BaseModel from browser_use import ActionResult, Agent, ChatOpenAI, Tools...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/examples/custom-functions/notification.py
examples/custom-functions/notification.py
import asyncio import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from dotenv import load_dotenv load_dotenv() from browser_use import ActionResult, Agent, ChatOpenAI, Tools tools = Tools() @tools.registry.action('Done with task') async def done(tex...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/examples/custom-functions/cua.py
examples/custom-functions/cua.py
""" OpenAI Computer Use Assistant (CUA) Integration This example demonstrates how to integrate OpenAI's Computer Use Assistant as a fallback action when standard browser actions are insufficient to achieve the desired goal. The CUA can perform complex computer interactions that might be difficult to achieve through re...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/qwen_omni_merge.py
scripts/qwen_omni_merge.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/bench_qwen.py
scripts/bench_qwen.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/pissa_init.py
scripts/pissa_init.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is based on the HuggingFace's PEFT library. # https://github.com/huggingface/peft/blob/v0.11.0/examples/pissa_finetuning/preprocess.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in comp...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/eval_bleu_rouge.py
scripts/eval_bleu_rouge.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/llama_pro.py
scripts/llama_pro.py
# Copyright 2025 Tencent Inc. and the LlamaFactory team. # # This code is inspired by the Tencent's LLaMA-Pro library. # https://github.com/TencentARC/LLaMA-Pro/blob/main/scripts/block_expansion.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with ...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/megatron_merge.py
scripts/megatron_merge.py
# Copyright 2025 the ROLL team and the LlamaFactory team. # # This code is modified from the ROLL library. # https://github.com/alibaba/ROLL/blob/main/mcore_adapter/tools/convert.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Y...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/vllm_infer.py
scripts/vllm_infer.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/loftq_init.py
scripts/loftq_init.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is based on the HuggingFace's PEFT library. # https://github.com/huggingface/peft/blob/v0.10.0/examples/loftq_finetuning/quantize_save_load.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/api_example/test_toolcall.py
scripts/api_example/test_toolcall.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/api_example/test_image.py
scripts/api_example/test_image.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/convert_ckpt/llamafy_qwen.py
scripts/convert_ckpt/llamafy_qwen.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/convert_ckpt/tiny_llama4.py
scripts/convert_ckpt/tiny_llama4.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/convert_ckpt/llamafy_baichuan2.py
scripts/convert_ckpt/llamafy_baichuan2.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/stat_utils/cal_mfu.py
scripts/stat_utils/cal_mfu.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/stat_utils/length_cdf.py
scripts/stat_utils/length_cdf.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/stat_utils/cal_lr.py
scripts/stat_utils/cal_lr.py
# Copyright 2025 imoneoi and the LlamaFactory team. # # This code is inspired by the imoneoi's OpenChat library. # https://github.com/imoneoi/openchat/blob/3.6.0/ochat/training_deepspeed/train.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with th...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/stat_utils/cal_flops.py
scripts/stat_utils/cal_flops.py
# Copyright 2025 Microsoft Corporation and the LlamaFactory team. # # This code is inspired by the Microsoft's DeepSpeed library. # https://www.deepspeed.ai/tutorials/flops-profiler/ # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # ...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/scripts/stat_utils/cal_ppl.py
scripts/stat_utils/cal_ppl.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/tests_v1/conftest.py
tests_v1/conftest.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/tests_v1/utils/test_batching_queue.py
tests_v1/utils/test_batching_queue.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/tests_v1/plugins/data_plugins/test_converter.py
tests_v1/plugins/data_plugins/test_converter.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/tests_v1/plugins/model_plugins/test_kernel_plugin.py
tests_v1/plugins/model_plugins/test_kernel_plugin.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/tests_v1/plugins/model_plugins/test_init_plugin.py
tests_v1/plugins/model_plugins/test_init_plugin.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/tests_v1/accelerator/test_interface.py
tests_v1/accelerator/test_interface.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/tests_v1/core/test_data_loader.py
tests_v1/core/test_data_loader.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/tests_v1/core/test_model_loader.py
tests_v1/core/test_model_loader.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/tests_v1/core/test_data_engine.py
tests_v1/core/test_data_engine.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/tests_v1/config/test_args_parser.py
tests_v1/config/test_args_parser.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/train.py
src/train.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/api.py
src/api.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/webui.py
src/webui.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/cli.py
src/llamafactory/cli.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/launcher.py
src/llamafactory/launcher.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/__init__.py
src/llamafactory/__init__.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/third_party/__init__.py
src/llamafactory/third_party/__init__.py
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/third_party/muon/muon.py
src/llamafactory/third_party/muon/muon.py
# Copyright 2025 Moonshot AI and the LlamaFactory team. # # This code is based on the MoonshotAI's Moonlight library. # https://github.com/MoonshotAI/Moonlight/blob/master/examples/toy_train.py # and the Keller Jordan's Muon library. # https://github.com/KellerJordan/Muon/blob/master/muon.py # # Licensed under the Apac...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/third_party/muon/__init__.py
src/llamafactory/third_party/muon/__init__.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/chat/kt_engine.py
src/llamafactory/chat/kt_engine.py
# Copyright 2025 the KVCache.AI team, Approaching AI, and the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/chat/hf_engine.py
src/llamafactory/chat/hf_engine.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/chat/vllm_engine.py
src/llamafactory/chat/vllm_engine.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/chat/sglang_engine.py
src/llamafactory/chat/sglang_engine.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/chat/chat_model.py
src/llamafactory/chat/chat_model.py
# Copyright 2025 THUDM and the LlamaFactory team. # # This code is inspired by the THUDM's ChatGLM implementation. # https://github.com/THUDM/ChatGLM-6B/blob/main/cli_demo.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/chat/__init__.py
src/llamafactory/chat/__init__.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/chat/base_engine.py
src/llamafactory/chat/base_engine.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/callbacks.py
src/llamafactory/train/callbacks.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/trainer_utils.py
src/llamafactory/train/trainer_utils.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the original GaLore's implementation: https://github.com/jiaweizzhao/GaLore # and the original LoRA+'s implementation: https://github.com/nikhil-ghosh-berkeley/loraplus # and the original BAdam's implementation: https://github.com...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/test_utils.py
src/llamafactory/train/test_utils.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/tuner.py
src/llamafactory/train/tuner.py
# Copyright 2025 the KVCache.AI team, Approaching AI, and the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/__init__.py
src/llamafactory/train/__init__.py
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/fp8_utils.py
src/llamafactory/train/fp8_utils.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/ppo/trainer.py
src/llamafactory/train/ppo/trainer.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's TRL library. # https://github.com/huggingface/trl/blob/v0.8.0/trl/trainer/ppo_trainer.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with t...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/ppo/__init__.py
src/llamafactory/train/ppo/__init__.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/ppo/workflow.py
src/llamafactory/train/ppo/workflow.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's TRL library. # https://github.com/huggingface/trl/blob/v0.8.0/examples/scripts/ppo.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/ppo/ppo_utils.py
src/llamafactory/train/ppo/ppo_utils.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/sft/trainer.py
src/llamafactory/train/sft/trainer.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's transformers library. # https://github.com/huggingface/transformers/blob/v4.40.0/src/transformers/trainer_seq2seq.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/sft/__init__.py
src/llamafactory/train/sft/__init__.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/sft/workflow.py
src/llamafactory/train/sft/workflow.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's transformers library. # https://github.com/huggingface/transformers/blob/v4.40.0/examples/pytorch/summarization/run_summarization.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may n...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/sft/metric.py
src/llamafactory/train/sft/metric.py
# Copyright 2025 HuggingFace Inc., THUDM, and the LlamaFactory team. # # This code is inspired by the HuggingFace's transformers library and the THUDM's ChatGLM implementation. # https://github.com/huggingface/transformers/blob/v4.40.0/examples/pytorch/summarization/run_summarization.py # https://github.com/THUDM/ChatG...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/pt/trainer.py
src/llamafactory/train/pt/trainer.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/pt/__init__.py
src/llamafactory/train/pt/__init__.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/pt/workflow.py
src/llamafactory/train/pt/workflow.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's transformers library. # https://github.com/huggingface/transformers/blob/v4.40.0/examples/pytorch/language-modeling/run_clm.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/dpo/trainer.py
src/llamafactory/train/dpo/trainer.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's TRL library. # https://github.com/huggingface/trl/blob/v0.8.0/trl/trainer/dpo_trainer.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with t...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/dpo/__init__.py
src/llamafactory/train/dpo/__init__.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/dpo/workflow.py
src/llamafactory/train/dpo/workflow.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's TRL library. # https://github.com/huggingface/trl/blob/v0.8.0/examples/scripts/dpo.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/dpo/ktrainer.py
src/llamafactory/train/dpo/ktrainer.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's TRL library. # https://github.com/huggingface/trl/blob/v0.8.0/trl/trainer/dpo_trainer.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with t...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/kto/trainer.py
src/llamafactory/train/kto/trainer.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's TRL library. # https://github.com/huggingface/trl/blob/v0.8.0/trl/trainer/kto_trainer.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with t...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/kto/__init__.py
src/llamafactory/train/kto/__init__.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/kto/workflow.py
src/llamafactory/train/kto/workflow.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's TRL library. # https://github.com/huggingface/trl/blob/v0.8.0/examples/scripts/kto.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/mca/trainer.py
src/llamafactory/train/mca/trainer.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/mca/__init__.py
src/llamafactory/train/mca/__init__.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/mca/workflow.py
src/llamafactory/train/mca/workflow.py
# Copyright 2025 the ROLL team and the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/rm/trainer.py
src/llamafactory/train/rm/trainer.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's transformers library. # https://github.com/huggingface/transformers/blob/v4.40.0/src/transformers/trainer.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except ...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/rm/__init__.py
src/llamafactory/train/rm/__init__.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/rm/workflow.py
src/llamafactory/train/rm/workflow.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's transformers library. # https://github.com/huggingface/transformers/blob/v4.40.0/examples/pytorch/summarization/run_summarization.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may n...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/train/rm/metric.py
src/llamafactory/train/rm/metric.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/patcher.py
src/llamafactory/model/patcher.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/loader.py
src/llamafactory/model/loader.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/__init__.py
src/llamafactory/model/__init__.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/adapter.py
src/llamafactory/model/adapter.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/kv_cache.py
src/llamafactory/model/model_utils/kv_cache.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/quantization.py
src/llamafactory/model/model_utils/quantization.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's Transformers and Optimum library. # https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/utils/quantization_config.py # https://github.com/huggingface/optimum/blob/v1.20.0/optimum/gptq/data.p...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/liger_kernel.py
src/llamafactory/model/model_utils/liger_kernel.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/packing.py
src/llamafactory/model/model_utils/packing.py
# Copyright 2025 Musab Gultekin and the LlamaFactory team. # # This code is based on the Musab Gultekin's functionary library. # https://github.com/MeetKai/functionary/blob/main/functionary/train/packing/monkey_patch_packing.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this f...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/checkpointing.py
src/llamafactory/model/model_utils/checkpointing.py
# Copyright 2025 HuggingFace Inc., Daniel Han-Chen & the Unsloth team and the LlamaFactory team. # # This code is inspired by the HuggingFace's Transformers and PEFT library, # https://github.com/huggingface/transformers/blob/v4.40.0/src/transformers/modeling_utils.py # https://github.com/huggingface/peft/blob/v0.10.0/...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/unsloth.py
src/llamafactory/model/model_utils/unsloth.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/visual.py
src/llamafactory/model/model_utils/visual.py
# Copyright 2025 HuggingFace Inc. and the LlamaFactory team. # # This code is inspired by the HuggingFace's Transformers library. # https://github.com/huggingface/transformers/blob/v4.40.0/src/transformers/models/llava/modeling_llava.py # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not u...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/mod.py
src/llamafactory/model/model_utils/mod.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/ktransformers.py
src/llamafactory/model/model_utils/ktransformers.py
# Copyright 2025 the KVCache.AI team, Approaching AI, and the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/misc.py
src/llamafactory/model/model_utils/misc.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/moe.py
src/llamafactory/model/model_utils/moe.py
# Copyright 2025 the LlamaFactory team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false
hiyouga/LlamaFactory
https://github.com/hiyouga/LlamaFactory/blob/f60a6e3d015962198b7c626936f117e83260bde9/src/llamafactory/model/model_utils/__init__.py
src/llamafactory/model/model_utils/__init__.py
python
Apache-2.0
f60a6e3d015962198b7c626936f117e83260bde9
2026-01-04T14:38:25.134237Z
false