emanuelaboros commited on
Commit
87e689b
·
verified ·
1 Parent(s): aa12a68

Update modeling_lang.py

Browse files
Files changed (1) hide show
  1. modeling_lang.py +12 -0
modeling_lang.py CHANGED
@@ -1,3 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  import torch
2
  import torch.nn as nn
3
  from transformers import PreTrainedModel
 
1
+ import subprocess
2
+ import sys
3
+
4
+ # Ensure floret is installed
5
+ try:
6
+ import floret
7
+ except ImportError:
8
+ print("Installing floret...")
9
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "floret"])
10
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "huggingface_hub"])
11
+ import floret
12
+
13
  import torch
14
  import torch.nn as nn
15
  from transformers import PreTrainedModel