Datasets:

ArXiv:
Elron commited on
Commit
e75adba
1 Parent(s): 5b6b333

Upload register.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. register.py +17 -0
register.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from .artifact import Artifact
2
+ from . import blocks
3
+
4
+ import inspect
5
+
6
+
7
+ def register_blocks():
8
+ # Iterate over every object in the blocks module
9
+ for name, obj in inspect.getmembers(blocks):
10
+ # Make sure the object is a class
11
+ if inspect.isclass(obj):
12
+ # Make sure the class is a subclass of Artifact (but not Artifact itself)
13
+ if issubclass(obj, Artifact) and obj is not Artifact:
14
+ Artifact.register_class(obj)
15
+
16
+
17
+ register_blocks()