Skip to content

Commit

Permalink
Merge branch 'keras-team:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kernel-loophole authored Jan 30, 2025
2 parents e21c509 + e625699 commit e00b6c1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scripts/auto-assignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = async ({ github, context }) => {
// Is this an issue? If so, assign the issue number. Otherwise, assign the PR number.
if (context.payload.issue) {
//assignee List for issues.
assigneesList = ["SuryanarayanaY", "sachinprasadhs"];
assigneesList = ["mehtamansi29","sonali-kumari1", "sachinprasadhs"];
issueNumber = context.payload.issue.number;
} else {
//assignee List for PRs.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ print(keras_hub.utils.decode_imagenet_predictions(preds))
Load a Bert model and fine-tune it on IMDb movie reviews:

```python
classifier = keras_hub.models.BertClassifier.from_preset(
classifier = keras_hub.models.TextClassifier.from_preset(
"bert_base_en_uncased",
activation="softmax",
num_classes=2,
Expand Down
2 changes: 1 addition & 1 deletion keras_hub/src/utils/preset_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def tf_copy_gfile_to_cache(preset, path):
try:
import tensorflow as tf

os.make_dirs(os.path.dirname(local_path), exist_ok=True)
os.makedirs(os.path.dirname(local_path), exist_ok=True)
tf.io.gfile.copy(url, local_path)
except Exception as e:
# gfile.copy will leave an empty file after an error.
Expand Down
12 changes: 12 additions & 0 deletions keras_hub/src/utils/preset_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ def test_preset_errors(self):
with self.assertRaisesRegex(ValueError, "class keras_hub>BortBackbone"):
BertBackbone.from_preset(preset_dir)

@pytest.mark.large
def test_tf_file_io(self):
# Load a model from Kaggle to use as a test model.
preset = "bert_tiny_en_uncased"
backbone = BertBackbone.from_preset(preset)
# Save the model on a local directory.
temp_dir = self.get_temp_dir()
local_preset_dir = os.path.join(temp_dir, "bert_preset")
backbone.save_to_preset(local_preset_dir)
# Load with "file://" which tf supports.
backbone = BertBackbone.from_preset("file://" + local_preset_dir)

@pytest.mark.large
def test_upload_empty_preset(self):
temp_dir = self.get_temp_dir()
Expand Down

0 comments on commit e00b6c1

Please sign in to comment.