Upload handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
|
@@ -14,7 +14,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 14 |
class EndpointHandler():
|
| 15 |
def __init__(self, path=""):
|
| 16 |
config = PeftConfig.from_pretrained(path)
|
| 17 |
-
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, load_in_8bit=True, device_map='auto')
|
| 18 |
self.tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
|
| 19 |
# Load the Lora model
|
| 20 |
self.model = PeftModel.from_pretrained(model, path)
|
|
|
|
| 14 |
class EndpointHandler():
|
| 15 |
def __init__(self, path=""):
|
| 16 |
config = PeftConfig.from_pretrained(path)
|
| 17 |
+
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, load_in_8bit=True, trust_remote_code=True, device_map='auto')
|
| 18 |
self.tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
|
| 19 |
# Load the Lora model
|
| 20 |
self.model = PeftModel.from_pretrained(model, path)
|