Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStream
|
|
8 |
|
9 |
MAX_MAX_NEW_TOKENS = 2048
|
10 |
DEFAULT_MAX_NEW_TOKENS = 1024
|
11 |
-
MAX_INPUT_TOKEN_LENGTH =
|
12 |
|
13 |
DESCRIPTION = """\
|
14 |
# CLEX-7B-Chat-16K
|
@@ -52,7 +52,7 @@ from modeling_llama import LlamaForCausalLM
|
|
52 |
# config = CLEXLlamaConfig.from_pretrained(
|
53 |
# model_id
|
54 |
# )
|
55 |
-
model = LlamaForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, trust_remote_code=True, low_cpu_mem_usage=True)
|
56 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
57 |
tokenizer.use_default_system_prompt = False
|
58 |
|
|
|
8 |
|
9 |
MAX_MAX_NEW_TOKENS = 2048
|
10 |
DEFAULT_MAX_NEW_TOKENS = 1024
|
11 |
+
MAX_INPUT_TOKEN_LENGTH = 65536
|
12 |
|
13 |
DESCRIPTION = """\
|
14 |
# CLEX-7B-Chat-16K
|
|
|
52 |
# config = CLEXLlamaConfig.from_pretrained(
|
53 |
# model_id
|
54 |
# )
|
55 |
+
model = LlamaForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, trust_remote_code=True, low_cpu_mem_usage=True, device_map="auto")
|
56 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
57 |
tokenizer.use_default_system_prompt = False
|
58 |
|