Spaces:
Running on Zero
Running on Zero
Update app/main.py
Browse files- app/main.py +3 -2
app/main.py
CHANGED
|
@@ -13,8 +13,9 @@ tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
|
| 13 |
model = AutoModelForCausalLM.from_pretrained(
|
| 14 |
model_id,
|
| 15 |
trust_remote_code=True,
|
| 16 |
-
attn_implementation="eager", #
|
| 17 |
-
device_map="auto"
|
|
|
|
| 18 |
)
|
| 19 |
llm_pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 20 |
|
|
|
|
| 13 |
model = AutoModelForCausalLM.from_pretrained(
|
| 14 |
model_id,
|
| 15 |
trust_remote_code=True,
|
| 16 |
+
attn_implementation="eager", # Solves the window_size error
|
| 17 |
+
device_map="auto", # Requires accelerate
|
| 18 |
+
torch_dtype="auto", # Use the best dtype automatically
|
| 19 |
)
|
| 20 |
llm_pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 21 |
|