NYUAD-ComNets commited on
Commit
591a846
·
verified ·
1 Parent(s): 2965f7e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +21 -0
README.md CHANGED
@@ -34,6 +34,27 @@ The proposed solutions offer a more nuanced understanding of memes for accurate
34
 
35
  ``` python
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  import numpy as np
38
  import torch
39
  import torch._dynamo
 
34
 
35
  ``` python
36
 
37
+
38
+ import os
39
+ import torch
40
+
41
+ # 1. Create a dummy pass-through decorator to replace torch.compile
42
+ def dummy_compile(fn=None, *args, **kwargs):
43
+ if fn is None:
44
+ return lambda x: x
45
+ return fn
46
+
47
+ # 2. Patch torch.compile BEFORE unsloth imports
48
+ torch.compile = dummy_compile
49
+ os.environ["UNSLOTH_FUSED_FORWARD"] = "0"
50
+ os.environ["UNSLOTH_DISABLE_AUTO_UPDATES"] = "1"
51
+
52
+ # 3. Import Unsloth safely now
53
+ from unsloth import FastVisionModel
54
+
55
+ print("SUCCESS: Unsloth loaded smoothly without compiler errors!")
56
+
57
+
58
  import numpy as np
59
  import torch
60
  import torch._dynamo