Upload generate-embeddings-open.py
Browse files
openclip/generate-embeddings-open.py
CHANGED
@@ -30,6 +30,18 @@ from safetensors.torch import save_file
|
|
30 |
mtype='ViT-L-14'
|
31 |
mname='openai'
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
#### Warning, this requires more than 4GB vram
|
34 |
#mtype='ViT-H-14-quickgelu'
|
35 |
#mname='dfn5b'
|
|
|
30 |
mtype='ViT-L-14'
|
31 |
mname='openai'
|
32 |
|
33 |
+
import argparse
|
34 |
+
parser = argparse.ArgumentParser(
|
35 |
+
prog='generate-embeddings',
|
36 |
+
epilog=f"defaults: mtype={mtype}, mname={mname}",
|
37 |
+
description='Read in "dictionary" wordlist and generate calculated embeddings')
|
38 |
+
parser.add_argument('--mtype',default=mtype)
|
39 |
+
parser.add_argument('--mname',default=mname)
|
40 |
+
args = parser.parse_args()
|
41 |
+
|
42 |
+
mtype=args.mtype
|
43 |
+
mname=args.mname
|
44 |
+
|
45 |
#### Warning, this requires more than 4GB vram
|
46 |
#mtype='ViT-H-14-quickgelu'
|
47 |
#mname='dfn5b'
|