[Feature] Add LoRA support for embedding layers (#14177)
Co-authored-by: Baizhou Zhang <sobereddiezhang@gmail.com> Co-authored-by: Beichen-Ma <bm685@cornell.edu>
This commit is contained in:
co-authored by
Baizhou Zhang
Beichen-Ma
parent
9ad02b799d
commit
0c63fb9420
@@ -436,6 +436,7 @@ class HFRunner:
|
||||
)
|
||||
else:
|
||||
model = base_model
|
||||
|
||||
if patch_model_do_sample_false:
|
||||
model.generation_config.do_sample = False
|
||||
outputs = model.generate(
|
||||
@@ -455,6 +456,7 @@ class HFRunner:
|
||||
text = tokenizer.decode(
|
||||
outputs[0][0][len(input_ids[0]) :], skip_special_tokens=True
|
||||
)
|
||||
|
||||
# Check if the text is empty or only whitespace.
|
||||
if not text.strip():
|
||||
raise ValueError(
|
||||
|
||||
Reference in New Issue
Block a user