Spaces:
Runtime error
Runtime error
Commit
·
7139589
1
Parent(s):
b24a077
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ dataset = load_dataset(dataset_name, split="train")
|
|
| 9 |
# We will be loading the Falcon 7B model, applying 4bit quantization to it, and then adding LoRA adapters to the model.
|
| 10 |
import torch
|
| 11 |
|
| 12 |
-
|
| 13 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
| 14 |
|
| 15 |
# Defining the name of the Falcon model
|
|
@@ -23,7 +23,7 @@ bnb_4bit_compute_dtype=torch.float16,
|
|
| 23 |
)
|
| 24 |
|
| 25 |
# Loading the Falcon model with quantization configuration
|
| 26 |
-
model =
|
| 27 |
model_name,
|
| 28 |
quantization_config=bnb_config,
|
| 29 |
trust_remote_code=True
|
|
|
|
| 9 |
# We will be loading the Falcon 7B model, applying 4bit quantization to it, and then adding LoRA adapters to the model.
|
| 10 |
import torch
|
| 11 |
|
| 12 |
+
from transformers import FalconForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
| 13 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
| 14 |
|
| 15 |
# Defining the name of the Falcon model
|
|
|
|
| 23 |
)
|
| 24 |
|
| 25 |
# Loading the Falcon model with quantization configuration
|
| 26 |
+
model = FalconForCausalLM.from_pretrained(
|
| 27 |
model_name,
|
| 28 |
quantization_config=bnb_config,
|
| 29 |
trust_remote_code=True
|