HowWebWorks commited on
Commit Β·
79e137c
1
Parent(s): ed658dd
put everything in root
Browse files- model/README.md β README.md +0 -0
- model/added_tokens.json β added_tokens.json +0 -0
- model/config.json β config.json +0 -0
- model/configuration_intern_vit.py β configuration_intern_vit.py +0 -0
- model/configuration_internlm2.py β configuration_internlm2.py +0 -0
- model/configuration_internvl_chat.py β configuration_internvl_chat.py +0 -0
- model/conversation.py β conversation.py +0 -0
- model/generation_config.json β generation_config.json +0 -0
- handler.py +2 -3
- model/model-00001-of-00004.safetensors β model-00001-of-00004.safetensors +0 -0
- model/model-00002-of-00004.safetensors β model-00002-of-00004.safetensors +0 -0
- model/model-00003-of-00004.safetensors β model-00003-of-00004.safetensors +0 -0
- model/model-00004-of-00004.safetensors β model-00004-of-00004.safetensors +0 -0
- model/model.safetensors.index.json β model.safetensors.index.json +0 -0
- model/modeling_intern_vit.py β modeling_intern_vit.py +0 -0
- model/modeling_internlm2.py β modeling_internlm2.py +0 -0
- model/modeling_internvl_chat.py β modeling_internvl_chat.py +0 -0
- model/special_tokens_map.json β special_tokens_map.json +0 -0
- model/tokenization_internlm2.py β tokenization_internlm2.py +0 -0
- model/tokenizer.model β tokenizer.model +0 -0
- model/tokenizer_config.json β tokenizer_config.json +0 -0
model/README.md β README.md
RENAMED
|
File without changes
|
model/added_tokens.json β added_tokens.json
RENAMED
|
File without changes
|
model/config.json β config.json
RENAMED
|
File without changes
|
model/configuration_intern_vit.py β configuration_intern_vit.py
RENAMED
|
File without changes
|
model/configuration_internlm2.py β configuration_internlm2.py
RENAMED
|
File without changes
|
model/configuration_internvl_chat.py β configuration_internvl_chat.py
RENAMED
|
File without changes
|
model/conversation.py β conversation.py
RENAMED
|
File without changes
|
model/generation_config.json β generation_config.json
RENAMED
|
File without changes
|
handler.py
CHANGED
|
@@ -7,14 +7,13 @@ class EndpointHandler:
|
|
| 7 |
"""Custom handler for NuExtract-2-8B (InternLM2 based)."""
|
| 8 |
|
| 9 |
def __init__(self, path: str = "") -> None:
|
| 10 |
-
model_path = os.path.join(path, "model")
|
| 11 |
# βββ allow the repoβs custom configuration & modelling code
|
| 12 |
self.tokenizer = AutoTokenizer.from_pretrained(
|
| 13 |
-
|
| 14 |
trust_remote_code=True # β mandatory
|
| 15 |
)
|
| 16 |
self.model = AutoModelForCausalLM.from_pretrained(
|
| 17 |
-
|
| 18 |
trust_remote_code=True, # β mandatory
|
| 19 |
torch_dtype=torch.float16, # fits on a 16 GB GPU
|
| 20 |
device_map="auto" # put tensors on the GPU
|
|
|
|
| 7 |
"""Custom handler for NuExtract-2-8B (InternLM2 based)."""
|
| 8 |
|
| 9 |
def __init__(self, path: str = "") -> None:
|
|
|
|
| 10 |
# βββ allow the repoβs custom configuration & modelling code
|
| 11 |
self.tokenizer = AutoTokenizer.from_pretrained(
|
| 12 |
+
path,
|
| 13 |
trust_remote_code=True # β mandatory
|
| 14 |
)
|
| 15 |
self.model = AutoModelForCausalLM.from_pretrained(
|
| 16 |
+
path,
|
| 17 |
trust_remote_code=True, # β mandatory
|
| 18 |
torch_dtype=torch.float16, # fits on a 16 GB GPU
|
| 19 |
device_map="auto" # put tensors on the GPU
|
model/model-00001-of-00004.safetensors β model-00001-of-00004.safetensors
RENAMED
|
File without changes
|
model/model-00002-of-00004.safetensors β model-00002-of-00004.safetensors
RENAMED
|
File without changes
|
model/model-00003-of-00004.safetensors β model-00003-of-00004.safetensors
RENAMED
|
File without changes
|
model/model-00004-of-00004.safetensors β model-00004-of-00004.safetensors
RENAMED
|
File without changes
|
model/model.safetensors.index.json β model.safetensors.index.json
RENAMED
|
File without changes
|
model/modeling_intern_vit.py β modeling_intern_vit.py
RENAMED
|
File without changes
|
model/modeling_internlm2.py β modeling_internlm2.py
RENAMED
|
File without changes
|
model/modeling_internvl_chat.py β modeling_internvl_chat.py
RENAMED
|
File without changes
|
model/special_tokens_map.json β special_tokens_map.json
RENAMED
|
File without changes
|
model/tokenization_internlm2.py β tokenization_internlm2.py
RENAMED
|
File without changes
|
model/tokenizer.model β tokenizer.model
RENAMED
|
File without changes
|
model/tokenizer_config.json β tokenizer_config.json
RENAMED
|
File without changes
|