mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-24 06:42:52 +08:00
fix webui
Former-commit-id: e23a3a366c5419506bf18bebcb2d679b87e7976b
This commit is contained in:
parent
4242897b78
commit
91d178f14d
@ -128,7 +128,7 @@ def load_model_and_tokenizer(
|
|||||||
model = init_adapter(model, model_args, finetuning_args, is_trainable, is_mergeable)
|
model = init_adapter(model, model_args, finetuning_args, is_trainable, is_mergeable)
|
||||||
|
|
||||||
if stage == "rm" or stage == "ppo": # add value head
|
if stage == "rm" or stage == "ppo": # add value head
|
||||||
model = AutoModelForCausalLMWithValueHead.from_pretrained(model)
|
model: "AutoModelForCausalLMWithValueHead" = AutoModelForCausalLMWithValueHead.from_pretrained(model)
|
||||||
reset_logging()
|
reset_logging()
|
||||||
|
|
||||||
if stage == "rm" and model_args.checkpoint_dir is not None: # load valuehead weights to evaluate reward model
|
if stage == "rm" and model_args.checkpoint_dir is not None: # load valuehead weights to evaluate reward model
|
||||||
|
@ -10,7 +10,7 @@ from llmtuner.webui.locales import ALERTS
|
|||||||
|
|
||||||
class WebChatModel(ChatModel):
|
class WebChatModel(ChatModel):
|
||||||
|
|
||||||
def __init__(self, args: Optional[Dict[str, Any]]) -> None:
|
def __init__(self, args: Optional[Dict[str, Any]] = None) -> None:
|
||||||
self.model = None
|
self.model = None
|
||||||
self.tokenizer = None
|
self.tokenizer = None
|
||||||
self.generating_args = GeneratingArguments()
|
self.generating_args = GeneratingArguments()
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
from llmtuner import run_exp
|
from llmtuner import run_exp
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
run_exp()
|
run_exp()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user