mirror of
				https://github.com/hiyouga/LLaMA-Factory.git
				synced 2025-11-04 09:52:14 +08:00 
			
		
		
		
	[v1] add v1 folders (#9225)
This commit is contained in:
		
							parent
							
								
									a0d44c650a
								
							
						
					
					
						commit
						1d96c62df2
					
				@ -25,12 +25,13 @@ USAGE = (
 | 
			
		||||
    + "| Usage:                                                             |\n"
 | 
			
		||||
    + "|   llamafactory-cli api -h: launch an OpenAI-style API server       |\n"
 | 
			
		||||
    + "|   llamafactory-cli chat -h: launch a chat interface in CLI         |\n"
 | 
			
		||||
    + "|   llamafactory-cli eval -h: evaluate models                        |\n"
 | 
			
		||||
    + "|   llamafactory-cli export -h: merge LoRA adapters and export model |\n"
 | 
			
		||||
    + "|   llamafactory-cli train -h: train models                          |\n"
 | 
			
		||||
    + "|   llamafactory-cli webchat -h: launch a chat interface in Web UI   |\n"
 | 
			
		||||
    + "|   llamafactory-cli webui: launch LlamaBoard                        |\n"
 | 
			
		||||
    + "|   llamafactory-cli env: show environment info                      |\n"
 | 
			
		||||
    + "|   llamafactory-cli version: show version info                      |\n"
 | 
			
		||||
    + "| Hint: You can use `lmf` as a shortcut for `llamafactory-cli`.      |\n"
 | 
			
		||||
    + "-" * 70
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@ -48,9 +49,7 @@ def _run_chat():
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def _run_eval():
 | 
			
		||||
    from .eval.evaluator import run_eval
 | 
			
		||||
 | 
			
		||||
    return run_eval()
 | 
			
		||||
    raise NotImplementedError("Evaluation will be deprecated in the future.")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def _export_model():
 | 
			
		||||
 | 
			
		||||
@ -15,22 +15,22 @@
 | 
			
		||||
# See the License for the specific language governing permissions and
 | 
			
		||||
# limitations under the License.
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
import platform
 | 
			
		||||
 | 
			
		||||
import accelerate
 | 
			
		||||
import datasets
 | 
			
		||||
import peft
 | 
			
		||||
import torch
 | 
			
		||||
import transformers
 | 
			
		||||
import trl
 | 
			
		||||
from transformers.utils import is_torch_cuda_available, is_torch_npu_available
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
VERSION = "0.9.4.dev0"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def print_env() -> None:
 | 
			
		||||
    import os
 | 
			
		||||
    import platform
 | 
			
		||||
 | 
			
		||||
    import accelerate
 | 
			
		||||
    import datasets
 | 
			
		||||
    import peft
 | 
			
		||||
    import torch
 | 
			
		||||
    import transformers
 | 
			
		||||
    import trl
 | 
			
		||||
    from transformers.utils import is_torch_cuda_available, is_torch_npu_available
 | 
			
		||||
 | 
			
		||||
    info = {
 | 
			
		||||
        "`llamafactory` version": VERSION,
 | 
			
		||||
        "Platform": platform.platform(),
 | 
			
		||||
 | 
			
		||||
@ -12,10 +12,10 @@
 | 
			
		||||
# See the License for the specific language governing permissions and
 | 
			
		||||
# limitations under the License.
 | 
			
		||||
 | 
			
		||||
from llamafactory.train.tuner import run_exp  # use absolute import
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def launch():
 | 
			
		||||
    from llamafactory.train.tuner import run_exp  # use absolute import
 | 
			
		||||
 | 
			
		||||
    run_exp()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										0
									
								
								src/llamafactory/v1/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/core/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/core/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/core/base_trainer.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/core/base_trainer.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/core/chat_sampler.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/core/chat_sampler.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/core/data_loader.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/core/data_loader.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/core/model_engine.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/core/model_engine.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/launcher.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/launcher.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/plugins/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/plugins/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/plugins/model_plugins/peft.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/plugins/model_plugins/peft.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/plugins/sampler_plugins/vllm.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/plugins/sampler_plugins/vllm.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/trainers/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/trainers/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/trainers/dpo_trainer.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/trainers/dpo_trainer.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/trainers/rm_trainer.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/trainers/rm_trainer.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								src/llamafactory/v1/trainers/sft_trainer.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/llamafactory/v1/trainers/sft_trainer.py
									
									
									
									
									
										Normal file
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user