Feature Extraction
Transformers
TensorBoard
Safetensors
English
captionbert_v2
sentence-similarity
consensus-distillation
geometric-deep-learning
amoe
custom_code
Instructions to use AbstractPhil/captionbert-8192-v2-b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AbstractPhil/captionbert-8192-v2-b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="AbstractPhil/captionbert-8192-v2-b", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AbstractPhil/captionbert-8192-v2-b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_captionbert.py
Browse files- modeling_captionbert.py +9 -2
modeling_captionbert.py
CHANGED
|
@@ -315,9 +315,16 @@ def _attach_amoe(self, arms=None, dispatch=None, repo=None, tau=None, verify=Tru
|
|
| 315 |
present = set()
|
| 316 |
dispatch = next((c for c in AMOE_DISPATCH_CANDIDATES if c in present), None)
|
| 317 |
if dispatch is None:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 318 |
raise FileNotFoundError(
|
| 319 |
-
f"no dispatch found in {repo}. Tried
|
| 320 |
-
f"
|
| 321 |
print(f"[amoe] dispatch: {repo}/{dispatch}")
|
| 322 |
if dispatch is False:
|
| 323 |
dispatch = None
|
|
|
|
| 315 |
present = set()
|
| 316 |
dispatch = next((c for c in AMOE_DISPATCH_CANDIDATES if c in present), None)
|
| 317 |
if dispatch is None:
|
| 318 |
+
local = os.path.isdir(str(repo))
|
| 319 |
+
hint = (f"'{repo}' is a LOCAL DIRECTORY, so there is no hub repo to "
|
| 320 |
+
f"search. Pass the repo explicitly:\n"
|
| 321 |
+
f" model.attach_amoe(repo='AbstractPhil/captionbert-8192-v2-B')"
|
| 322 |
+
if local else
|
| 323 |
+
f"Pass dispatch=<path in {repo}>, or dispatch=False to attach "
|
| 324 |
+
f"an UNTRAINED dispatch.")
|
| 325 |
raise FileNotFoundError(
|
| 326 |
+
f"no dispatch found in {repo}. Tried "
|
| 327 |
+
f"{list(AMOE_DISPATCH_CANDIDATES)}.\n {hint}")
|
| 328 |
print(f"[amoe] dispatch: {repo}/{dispatch}")
|
| 329 |
if dispatch is False:
|
| 330 |
dispatch = None
|