yonikremer
commited on
Commit
•
6eb1b44
1
Parent(s):
b1dd47e
deleted models from auto download list
Browse files- on_server_start.py +2 -8
on_server_start.py
CHANGED
@@ -3,7 +3,7 @@ A script that is run when the server starts.
|
|
3 |
"""
|
4 |
import os
|
5 |
|
6 |
-
from transformers import AutoModelForCausalLM
|
7 |
|
8 |
DOWNLOADED_MODELS_DIR = os.path.join(os.path.dirname(__file__), 'models')
|
9 |
|
@@ -14,10 +14,7 @@ def download_model(model_name: str):
|
|
14 |
:param model_name: The name of the model to download.
|
15 |
"""
|
16 |
print(f"Downloading model: {model_name}")
|
17 |
-
|
18 |
-
del model
|
19 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
20 |
-
del tokenizer
|
21 |
print(f"Downloaded model: {model_name}")
|
22 |
|
23 |
|
@@ -29,9 +26,6 @@ def download_useful_models():
|
|
29 |
print("Downloading useful models...")
|
30 |
os.makedirs(DOWNLOADED_MODELS_DIR, exist_ok=True)
|
31 |
useful_models = (
|
32 |
-
"gpt2",
|
33 |
-
"EleutherAI/gpt-j-6B",
|
34 |
-
"sberbank-ai/mGPT",
|
35 |
"facebook/opt-125m",
|
36 |
)
|
37 |
for model_name in useful_models:
|
|
|
3 |
"""
|
4 |
import os
|
5 |
|
6 |
+
from transformers import AutoModelForCausalLM
|
7 |
|
8 |
DOWNLOADED_MODELS_DIR = os.path.join(os.path.dirname(__file__), 'models')
|
9 |
|
|
|
14 |
:param model_name: The name of the model to download.
|
15 |
"""
|
16 |
print(f"Downloading model: {model_name}")
|
17 |
+
AutoModelForCausalLM.from_pretrained(model_name)
|
|
|
|
|
|
|
18 |
print(f"Downloaded model: {model_name}")
|
19 |
|
20 |
|
|
|
26 |
print("Downloading useful models...")
|
27 |
os.makedirs(DOWNLOADED_MODELS_DIR, exist_ok=True)
|
28 |
useful_models = (
|
|
|
|
|
|
|
29 |
"facebook/opt-125m",
|
30 |
)
|
31 |
for model_name in useful_models:
|