Skip to content

Commit

Permalink
fix: upgrade to code formula model v1.0.1 (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Omenetti <[email protected]>
  • Loading branch information
Matteo-Omenetti authored Feb 5, 2025
1 parent a47673b commit d6a3549
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def predict(
temperature=temperature,
max_new_tokens=4096 - prompt_ids.shape[1],
use_cache=True,
no_repeat_ngram_size=300,
)
else:
with torch.autocast(device_type=self._device, dtype=torch.bfloat16):
Expand All @@ -217,6 +218,7 @@ def predict(
temperature=temperature,
max_new_tokens=4096 - prompt_ids.shape[1],
use_cache=True,
no_repeat_ngram_size=300,
)

outputs = self._tokenizer.batch_decode(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ def __call__(self, image):
return image


AutoImageProcessor.register(SamOptImageProcessor, SamOptImageProcessor)
AutoImageProcessor.register(
config_class="SamOptImageProcessor",
slow_image_processor_class=SamOptImageProcessor,
)
2 changes: 1 addition & 1 deletion tests/test_code_formula_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def init() -> dict:
}

# Download models from HF
artifact_path = snapshot_download(repo_id="ds4sd/CodeFormula", revision="v1.0.0")
artifact_path = snapshot_download(repo_id="ds4sd/CodeFormula", revision="v1.0.1")

init["artifact_path"] = artifact_path

Expand Down

0 comments on commit d6a3549

Please sign in to comment.