update
This commit is contained in:
parent
9bc3b5c8ca
commit
10077cf4c5
|
@ -142,26 +142,34 @@ if missing:
|
|||
#################################################################################################################
|
||||
|
||||
for missing_module in missing:
|
||||
msg(f"{BRK}!")
|
||||
log("SHELLED",f"INSTALLING MISSING PYTHON MODULE: {str(missing_module).upper()}",4)
|
||||
msg(f"!{BRK}!")
|
||||
run_cmd(f'{sys.executable} -um pip install {missing_module}')
|
||||
if missing_module=='asyncio':
|
||||
exec(f'import {missing_module}')
|
||||
elif missing_module=="sklearn":
|
||||
import sklearn
|
||||
elif missing_module=="numpy":
|
||||
import numpy as np
|
||||
elif missing_module=="requests":
|
||||
exec(f'import {missing_module}')
|
||||
elif missing_module=="torch":
|
||||
exec(f'import {missing_module}')
|
||||
import torch.nn.functional as F
|
||||
elif missing_module=="tqdm":
|
||||
from tqdm import tqdm
|
||||
elif missing_module=="transformers==2.3.0":
|
||||
from transformers import GPT2Config, GPT2LMHeadModel, GPT2Tokenizer
|
||||
|
||||
if not missing_module=="transformers==2.3.0":
|
||||
msg(f"{BRK}!")
|
||||
log("SHELLED",f"INSTALLING MISSING PYTHON MODULE: {str(missing_module).upper()}",4)
|
||||
msg(f"!{BRK}!")
|
||||
run_cmd(f'{sys.executable} -um pip install {missing_module}')
|
||||
if missing_module=='asyncio':
|
||||
exec(f'import {missing_module}')
|
||||
elif missing_module=="sklearn":
|
||||
import sklearn
|
||||
elif missing_module=="numpy":
|
||||
import numpy as np
|
||||
elif missing_module=="requests":
|
||||
exec(f'import {missing_module}')
|
||||
elif missing_module=="torch":
|
||||
exec(f'import {missing_module}')
|
||||
import torch.nn.functional as F
|
||||
elif missing_module=="tqdm":
|
||||
from tqdm import tqdm
|
||||
|
||||
#################################################################################################################
|
||||
#################################################################################################################
|
||||
|
||||
if "transformers==2.3.0" in missing:
|
||||
from transformers import GPT2Config, GPT2LMHeadModel, GPT2Tokenizer
|
||||
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
|
||||
if not missing:
|
||||
import asyncio
|
||||
import sklearn
|
||||
|
|
Loading…
Reference in New Issue