Text Classification
Transformers
Safetensors
PEFT
branchone
feature-extraction
decision-model
multimodal
custom-code
custom_code
Instructions to use ndemirdemir/BranchOne with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ndemirdemir/BranchOne with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ndemirdemir/BranchOne", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ndemirdemir/BranchOne", trust_remote_code=True, device_map="auto") - PEFT
How to use ndemirdemir/BranchOne with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Support anonymous and cached AutoModel loading
Browse filesAccept the matching authentication option Transformers forwards through adapter kwargs. Continue rejecting external adapter overrides. Model weights and inference computations are unchanged.
- modeling_branchone.py +11 -2
modeling_branchone.py
CHANGED
|
@@ -48,8 +48,17 @@ class BranchOneModel(PreTrainedModel):
|
|
| 48 |
raise TypeError("BranchOne takes no positional model arguments")
|
| 49 |
for key in ("_from_auto", "_commit_hash", "trust_remote_code"):
|
| 50 |
kwargs.pop(key, None)
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
if kwargs.pop("subfolder", ""):
|
| 54 |
raise ValueError("Load the root of the BranchOne model repository")
|
| 55 |
if kwargs:
|
|
|
|
| 48 |
raise TypeError("BranchOne takes no positional model arguments")
|
| 49 |
for key in ("_from_auto", "_commit_hash", "trust_remote_code"):
|
| 50 |
kwargs.pop(key, None)
|
| 51 |
+
adapter_kwargs = kwargs.pop("adapter_kwargs", None)
|
| 52 |
+
if adapter_kwargs:
|
| 53 |
+
# AutoModel copies its Hub authentication option here when PEFT is
|
| 54 |
+
# installed, including token=False for anonymous/offline loading.
|
| 55 |
+
# It does not select a different adapter; reject actual overrides.
|
| 56 |
+
if (
|
| 57 |
+
not isinstance(adapter_kwargs, dict)
|
| 58 |
+
or set(adapter_kwargs) != {"token"}
|
| 59 |
+
or adapter_kwargs["token"] != token
|
| 60 |
+
):
|
| 61 |
+
raise ValueError("External adapter overrides are not supported")
|
| 62 |
if kwargs.pop("subfolder", ""):
|
| 63 |
raise ValueError("Load the root of the BranchOne model repository")
|
| 64 |
if kwargs:
|