Text Generation
PEFT
Safetensors
English
instruction-tuning
multi-task
reasoning
email
summarization
chat
lora
qwen
deepseek
conversational
Instructions to use GilbertAkham/deepseek-R1-multitask-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use GilbertAkham/deepseek-R1-multitask-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B") model = PeftModel.from_pretrained(base_model, "GilbertAkham/deepseek-R1-multitask-lora") - Notebooks
- Google Colab
- Kaggle
Update handler.py
Browse files- handler.py +5 -2
handler.py
CHANGED
|
@@ -9,10 +9,13 @@ class EndpointHandler:
|
|
| 9 |
print("Loading merged model...")
|
| 10 |
self.tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH, trust_remote_code=True)
|
| 11 |
self.model = AutoModelForCausalLM.from_pretrained(
|
| 12 |
-
MODEL_PATH,
|
|
|
|
|
|
|
|
|
|
| 13 |
)
|
| 14 |
self.model.eval()
|
| 15 |
-
print("Model loaded successfully.")
|
| 16 |
|
| 17 |
def __call__(self, data):
|
| 18 |
prompt = data.get("inputs", "")
|
|
|
|
| 9 |
print("Loading merged model...")
|
| 10 |
self.tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH, trust_remote_code=True)
|
| 11 |
self.model = AutoModelForCausalLM.from_pretrained(
|
| 12 |
+
MODEL_PATH,
|
| 13 |
+
torch_dtype=torch.float16,
|
| 14 |
+
device_map="auto",
|
| 15 |
+
trust_remote_code=True
|
| 16 |
)
|
| 17 |
self.model.eval()
|
| 18 |
+
print("✅ Model loaded successfully.")
|
| 19 |
|
| 20 |
def __call__(self, data):
|
| 21 |
prompt = data.get("inputs", "")
|