Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -20,9 +20,13 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
20 |
token=hf_token,
|
21 |
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
22 |
device_map="auto",
|
|
|
|
|
23 |
trust_remote_code=True,
|
24 |
)
|
25 |
|
|
|
|
|
26 |
# Создаём пайплайн
|
27 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
28 |
|
|
|
20 |
token=hf_token,
|
21 |
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
22 |
device_map="auto",
|
23 |
+
offload_folder="offload",
|
24 |
+
offload_state_dict=True,
|
25 |
trust_remote_code=True,
|
26 |
)
|
27 |
|
28 |
+
os.makedirs("offload", exist_ok=True)
|
29 |
+
|
30 |
# Создаём пайплайн
|
31 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
32 |
|