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

SageMaker Studio support #192

Merged
merged 4 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/jupyter-ai-magics/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ dependencies = [
"ipython",
"pydantic",
"importlib_metadata~=5.2.0",
"langchain==0.0.158"
"langchain==0.0.159",
"typing_extensions==4.5.0"
]

[project.optional-dependencies]
Expand Down
8 changes: 4 additions & 4 deletions packages/jupyter-ai/jupyter_ai/actors/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ def create_llm_chain(self, provider: Type[BaseProvider], provider_params: Dict[s
)

def clear_memory(self):
if not self.memory:
return

# clear chain memory
self.memory.clear()
if self.memory:
self.memory.clear()

# clear transcript for existing chat clients
reply_message = ClearMessage()
self.reply_queue.put(reply_message)

# clear transcript for new chat clients
self.chat_history.clear()
if self.chat_history:
self.chat_history.clear()

def _process_message(self, message: HumanChatMessage):
self.get_llm_chain()
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def get_chat_user(self) -> ChatUser:

login = getpass.getuser()
return ChatUser(
username=self.current_user.username,
username=login,
initials=login[0].capitalize(),
name=login,
display_name=login,
Expand Down
4 changes: 2 additions & 2 deletions packages/jupyter-ai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ dependencies = [
"openai~=0.26",
"aiosqlite~=0.18",
"importlib_metadata~=5.2.0",
"langchain==0.0.158",
"langchain==0.0.159",
"tiktoken", # required for OpenAIEmbeddings
"jupyter_ai_magics",
"ray~=2.4.0", # Requires grpcio installation from conda
"faiss-cpu", # Not distributed by official repo
"wcmatch",
"typing_extensions==4.5.0"
]

dynamic = ["version", "description", "authors", "urls", "keywords"]
Expand Down
8 changes: 7 additions & 1 deletion packages/jupyter-ai/src/theme-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export async function pollUntilReady(): Promise<void> {
export async function getJupyterLabTheme(): Promise<Theme> {
await pollUntilReady();
const light = document.body.getAttribute('data-jp-theme-light');
const primaryFontColor = getCSSVariable('--jp-ui-font-color1');
return createTheme({
spacing: 4,
components: {
Expand Down Expand Up @@ -112,7 +113,7 @@ export async function getJupyterLabTheme(): Promise<Theme> {
dark: getCSSVariable('--jp-success-color0')
},
text: {
primary: getCSSVariable('--jp-ui-font-color1'),
primary: primaryFontColor,
secondary: getCSSVariable('--jp-ui-font-color2'),
disabled: getCSSVariable('--jp-ui-font-color3')
}
Expand All @@ -126,6 +127,11 @@ export async function getJupyterLabTheme(): Promise<Theme> {
htmlFontSize: 16,
button: {
textTransform: 'capitalize'
},
// this is undocumented as of the time of writing.
// https://stackoverflow.com/a/62950304/12548458
allVariants: {
color: primaryFontColor
}
}
});
Expand Down