39 lines
No EOL
825 B
Python
Executable file
Vendored
39 lines
No EOL
825 B
Python
Executable file
Vendored
#!.venv/bin/python3
|
|
import argparse
|
|
import subprocess
|
|
import sys
|
|
import os
|
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument("--ml", action="store_true", help="Flag to configure whether everything for machine learning should also be setup")
|
|
|
|
args = parser.parse_args()
|
|
|
|
necesarry_packages = [
|
|
"pandas",
|
|
]
|
|
|
|
ml_packages = [
|
|
"safetensors",
|
|
"datasets",
|
|
"torch",
|
|
"transformers",
|
|
]
|
|
|
|
packages_to_install = necesarry_packages
|
|
|
|
if args.ml:
|
|
packages_to_install += ml_packages
|
|
|
|
subprocess.run([sys.executable, "-m", "pip", "install", "--upgrade"] + packages_to_install)
|
|
|
|
old_dir = os.getcwd()
|
|
os.chdir("crates/client-wasm")
|
|
subprocess.run(["wasm-pack", "build", "--target", "web"])
|
|
os.chdir(old_dir)
|
|
|
|
|
|
if args.ml:
|
|
subprocess.run(["./scripts/export_crossencoder"])
|
|
subprocess.run(["./scripts/export_dual_encoder"]) |