Spaces:
Runtime error
Runtime error
Commit
·
e0f560f
1
Parent(s):
6a980d1
Update app.py
Browse files
app.py
CHANGED
@@ -11,8 +11,7 @@ model_path = "ayoolaolafenwa/ChatLM"
|
|
11 |
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
13 |
|
14 |
-
model = AutoModelForCausalLM.from_pretrained(model_path,
|
15 |
-
torch_dtype=torch.bfloat16, load_in_8bit=True)
|
16 |
|
17 |
class StopOnTokens(StoppingCriteria):
|
18 |
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool:
|
|
|
11 |
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
13 |
|
14 |
+
model = AutoModelForCausalLM.from_pretrained(model_path, device_map = "auto", torch_dtype=torch.bfloat16, load_in_8bit=True)
|
|
|
15 |
|
16 |
class StopOnTokens(StoppingCriteria):
|
17 |
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool:
|