Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates docs with reset, model lists #254

Merged
merged 14 commits into from
Jul 10, 2023
Merged
Prev Previous commit
Next Next commit
Renames model_help key to "help"
  • Loading branch information
JasonWeill authored and dlqqq committed Jul 10, 2023
commit d3a9dcdd45ee7bca07959f9ac8a60df53ebbe7fb
8 changes: 4 additions & 4 deletions packages/jupyter-ai-magics/jupyter_ai_magics/magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ def __init__(self, shell):
def _ai_bulleted_list_models_for_provider(self, provider_id, Provider):
output = ""
if len(Provider.models) == 1 and Provider.models[0] == "*":
if Provider.model_help is None:
if Provider.help is None:
output += f"* {PROVIDER_NO_MODELS}\n"
else:
output += f"* {Provider.model_help}\n"
output += f"* {Provider.help}\n"
else:
for model_id in Provider.models:
output += f"* {provider_id}:{model_id}\n"
Expand All @@ -161,10 +161,10 @@ def _ai_inline_list_models_for_provider(self, provider_id, Provider):
output = ""

if len(Provider.models) == 1 and Provider.models[0] == "*":
if Provider.model_help is None:
if Provider.help is None:
return PROVIDER_NO_MODELS
else:
return Provider.model_help
return Provider.help

for model_id in Provider.models:
output += f", `{provider_id}:{model_id}`"
Expand Down
6 changes: 3 additions & 3 deletions packages/jupyter-ai-magics/jupyter_ai_magics/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Config:
"""List of supported models by their IDs. For registry providers, this will
be just ["*"]."""

model_help: ClassVar[str] = None
help: ClassVar[str] = None
"""Text to display in lieu of a model list for a registry provider that does
not provide a list of models."""

Expand Down Expand Up @@ -181,7 +181,7 @@ class HfHubProvider(BaseProvider, HuggingFaceHub):
name = "Hugging Face Hub"
models = ["*"]
model_id_key = "repo_id"
model_help = "See https://huggingface.co/models for a list of models."
help = "See https://huggingface.co/models for a list of models."
# ipywidgets needed to suppress tqdm warning
# https://stackoverflow.com/questions/67998191
# tqdm is a dependency of huggingface_hub
Expand Down Expand Up @@ -371,7 +371,7 @@ class SmEndpointProvider(BaseProvider, SagemakerEndpoint):
models = ["*"]
model_id_key = "endpoint_name"
# This all needs to be on one line of markdown, for use in a table
model_help = (
help = (
"SageMaker endpoint names are created when you deploy a model. "
"For more information, see "
'["Create your endpoint and deploy your model"]'
Expand Down