AbstractPhil commited on
Commit
afacbb2
·
verified ·
1 Parent(s): fde50dd

Update modeling_captionbert.py

Browse files
Files changed (1) hide show
  1. 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 {list(AMOE_DISPATCH_CANDIDATES)}. "
320
- f"Pass dispatch=<path>, or dispatch=False for an untrained one.")
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