Update handler.py
Browse files- handler.py +5 -1
handler.py
CHANGED
@@ -2,11 +2,15 @@ from unsloth import FastLanguageModel
|
|
2 |
import torch
|
3 |
import os
|
4 |
|
|
|
5 |
class EndpointHandler:
|
6 |
def __init__(self, path=""):
|
7 |
# ระบุชื่อโมเดลที่คุณต้องการใช้งาน
|
8 |
model_name = "defog/llama-3-sqlcoder-8b"
|
9 |
-
|
|
|
|
|
|
|
10 |
# Configuration settings
|
11 |
max_seq_length = 2048
|
12 |
dtype = None # Keep as None, you can change later if needed
|
|
|
2 |
import torch
|
3 |
import os
|
4 |
|
5 |
+
|
6 |
class EndpointHandler:
|
7 |
def __init__(self, path=""):
|
8 |
# ระบุชื่อโมเดลที่คุณต้องการใช้งาน
|
9 |
model_name = "defog/llama-3-sqlcoder-8b"
|
10 |
+
|
11 |
+
torch.cuda.empty_cache()
|
12 |
+
os.environ[ "PYTORCH_CUDA_ALLOC_CONF" ] = "expandable_segments:True"
|
13 |
+
|
14 |
# Configuration settings
|
15 |
max_seq_length = 2048
|
16 |
dtype = None # Keep as None, you can change later if needed
|