Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: upgrade to code formula model v1.0.1 #75

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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