🚨 🚨 Fix custom code saving (#37716)
* Firstly: Better detection of when we're a custom class * Trigger tests * Let's break everything * make fixup * fix mistaken line doubling * Let's try to get rid of it from config classes at least * Let's try to get rid of it from config classes at least * Fixup image processor * no more circular import * Let's go back to setting `_auto_class` again * Let's go back to setting `_auto_class` again * stash commit * Revert the irrelevant changes until we figure out AutoConfig * Change tests since we're breaking expectations * make fixup * do the same for all custom classes * Cleanup for feature extractor tests * Cleanup tokenization tests too * typo * Fix tokenizer tests * make fixup * fix image processor test * make fixup * Remove warning from register_for_auto_class * Stop adding model info to auto map entirely * Remove todo * Remove the other todo * Let's start slapping _auto_class on models why not * Let's start slapping _auto_class on models why not * Make sure the tests know what's up * Make sure the tests know what's up * Completely remove add_model_info_to_* * Start adding _auto_class to models * Start adding _auto_class to models * Add a flaky decorator * Add a flaky decorator and import * stash commit * More message cleanup * make fixup * fix indent * Fix trust_remote_code prompts * make fixup * correct indentation * Reincorporate changes into dynamic_module_utils * Update call to trust_remote_code * make fixup * Fix video processors too * Fix video processors too * Remove is_flaky additions * make fixup
This commit is contained in:
@@ -174,17 +174,6 @@ class AutoVideoProcessorTest(unittest.TestCase):
|
||||
reloaded_video_processor = AutoVideoProcessor.from_pretrained(tmp_dir, trust_remote_code=True)
|
||||
self.assertEqual(reloaded_video_processor.__class__.__name__, "NewVideoProcessor")
|
||||
|
||||
# The image processor file is cached in the snapshot directory. So the module file is not changed after dumping
|
||||
# to a temp dir. Because the revision of the module file is not changed.
|
||||
# Test the dynamic module is loaded only once if the module file is not changed.
|
||||
self.assertIs(video_processor.__class__, reloaded_video_processor.__class__)
|
||||
|
||||
# Test the dynamic module is reloaded if we force it.
|
||||
reloaded_video_processor = AutoVideoProcessor.from_pretrained(
|
||||
"hf-internal-testing/test_dynamic_video_processor", trust_remote_code=True, force_download=True
|
||||
)
|
||||
self.assertIsNot(video_processor.__class__, reloaded_video_processor.__class__)
|
||||
|
||||
def test_new_video_processor_registration(self):
|
||||
try:
|
||||
AutoConfig.register("custom", CustomConfig)
|
||||
|
||||
Reference in New Issue
Block a user