Skip to content

Commit

Permalink
#0: Work around missing precommit black
Browse files Browse the repository at this point in the history
  • Loading branch information
yieldthought committed Jan 31, 2025
1 parent dc62c3f commit f360b0d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion models/demos/llama3/tests/generate_reference_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ def generate_reference_outputs(total_length, output_file, hf_model_name=None):
# https://huggingface.co/Qwen/Qwen2.5-7B-Instruct#processing-long-texts
if "Qwen" in hf_model_name:
config.rope_scaling = {"factor": 4.0, "original_max_position_embeddings": 32768, "type": "yarn"}
model = AutoModelForCausalLM.from_pretrained(hf_model_name, config=config, torch_dtype=torch.float32 if device=="cpu" else None, device_map="auto")
model = AutoModelForCausalLM.from_pretrained(
hf_model_name, config=config, torch_dtype=torch.float32 if device == "cpu" else None, device_map="auto"
)
model.eval()

else:
Expand Down

0 comments on commit f360b0d

Please sign in to comment.