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

Mock shareCallback to test UI on AIConfigEditor #1045

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

rossdanlm
Copy link
Contributor

@rossdanlm rossdanlm commented Jan 26, 2024

Mock shareCallback to test UI on AIConfigEditor

TSIA, just adding code so we can mock the UI


Stack created with Sapling. Best reviewed with ReviewStack.

rossdanlm pushed a commit that referenced this pull request Jan 26, 2024
Created a separate component for the shareButton to manage the `isLoading` state and show that in the UI

## Test Plan
Rebase on then do: #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path  =./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```


https://github.com/lastmile-ai/aiconfig/assets/151060367/0c177c59-54b8-4d04-adfa-aea6d78f5f07


https://github.com/lastmile-ai/aiconfig/assets/151060367/1abcce37-8ba4-4513-b826-ea0f9d7bb720

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path  =./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```
rossdanlm pushed a commit that referenced this pull request Jan 26, 2024
Created a separate component for the shareButton to manage the `isLoading` state and show that in the UI

## Test Plan
Rebase on then do: #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path  =./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

No Error Testing
https://github.com/lastmile-ai/aiconfig/assets/151060367/0c177c59-54b8-4d04-adfa-aea6d78f5f07

Error Testing
https://github.com/lastmile-ai/aiconfig/assets/151060367/1abcce37-8ba4-4513-b826-ea0f9d7bb720
rossdanlm pushed a commit that referenced this pull request Jan 26, 2024
Created a separate component for the shareButton to manage the `isLoading` state and show that in the UI

## Test Plan
Rebase on then do: #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path  =./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

No Error Testing

https://github.com/lastmile-ai/aiconfig/assets/151060367/0c177c59-54b8-4d04-adfa-aea6d78f5f07

Error Testing

https://github.com/lastmile-ai/aiconfig/assets/151060367/1abcce37-8ba4-4513-b826-ea0f9d7bb720
rossdanlm pushed a commit that referenced this pull request Jan 26, 2024
Created a separate component for the shareButton to manage the `isLoading` state and show that in the UI

## Test Plan
Rebase on then do: #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path  =./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

No Error Testing

https://github.com/lastmile-ai/aiconfig/assets/151060367/0c177c59-54b8-4d04-adfa-aea6d78f5f07

Error Testing

https://github.com/lastmile-ai/aiconfig/assets/151060367/1abcce37-8ba4-4513-b826-ea0f9d7bb720
rossdanlm pushed a commit that referenced this pull request Jan 26, 2024
Created a separate component for the shareButton to manage the `isLoading` state and show that in the UI

## Test Plan
Rebase on then do: #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path  =./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

No Error Testing

https://github.com/lastmile-ai/aiconfig/assets/151060367/0c177c59-54b8-4d04-adfa-aea6d78f5f07

Error Testing

https://github.com/lastmile-ai/aiconfig/assets/151060367/1abcce37-8ba4-4513-b826-ea0f9d7bb720
rossdanlm pushed a commit that referenced this pull request Jan 26, 2024
Created a separate component for the shareButton to manage the `isLoading` state and show that in the UI

## Test Plan
Rebase on then do: #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path  =./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

No Error Testing

https://github.com/lastmile-ai/aiconfig/assets/151060367/0c177c59-54b8-4d04-adfa-aea6d78f5f07

Error Testing

https://github.com/lastmile-ai/aiconfig/assets/151060367/1abcce37-8ba4-4513-b826-ea0f9d7bb720
rossdanlm pushed a commit that referenced this pull request Jan 26, 2024
Created a separate component for the shareButton to manage the `isLoading` state and show that in the UI

## Test Plan
Rebase on then do: #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path  =./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

No Error Testing

https://github.com/lastmile-ai/aiconfig/assets/151060367/1e9f4b90-a9e9-4c60-a813-afa2a46a1b5a

Error Testing

https://github.com/lastmile-ai/aiconfig/assets/151060367/1abcce37-8ba4-4513-b826-ea0f9d7bb720
rossdanlm added a commit that referenced this pull request Jan 26, 2024
Share Button [7/n]: Display loading UI

Created a separate component for the shareButton to manage the
`isLoading` state and show that in the UI

## Test Plan
Rebase on then do: #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path  =./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

No Error Testing


https://github.com/lastmile-ai/aiconfig/assets/151060367/1e9f4b90-a9e9-4c60-a813-afa2a46a1b5a

Error Testing


https://github.com/lastmile-ai/aiconfig/assets/151060367/1abcce37-8ba4-4513-b826-ea0f9d7bb720

---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/1044).
* #1045
* #1049
* __->__ #1044
rossdanlm pushed a commit that referenced this pull request Jan 29, 2024
If the download callback is defined (not for local editor or VSCode, but will be for Gradio), then we display it and use the loading state to disable you from clicking on the button

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path  =./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```
rossdanlm pushed a commit that referenced this pull request Jan 29, 2024
If the download callback is defined (not for local editor or VSCode, but will be for Gradio), then we display it and use the loading state to disable you from clicking on the button

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path  =./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```
rossdanlm pushed a commit that referenced this pull request Jan 29, 2024
If the download callback is defined (not for local editor or VSCode, but will be for Gradio), then we display it and use the loading state to disable you from clicking on the button

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

https://github.com/lastmile-ai/aiconfig/assets/151060367/123319cf-2e92-49e8-8f93-2d930a3b0ac7
rossdanlm pushed a commit that referenced this pull request Jan 29, 2024
If the download callback is defined (not for local editor or VSCode, but will be for Gradio), then we display it and use the loading state to disable you from clicking on the button

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

https://github.com/lastmile-ai/aiconfig/assets/151060367/123319cf-2e92-49e8-8f93-2d930a3b0ac7
rossdanlm pushed a commit that referenced this pull request Jan 29, 2024
If the download callback is defined (not for local editor or VSCode, but will be for Gradio), then we display it and use the loading state to disable you from clicking on the button

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

https://github.com/lastmile-ai/aiconfig/assets/151060367/123319cf-2e92-49e8-8f93-2d930a3b0ac7
rossdanlm pushed a commit that referenced this pull request Jan 29, 2024
If the download callback is defined (not for local editor or VSCode, but will be for Gradio), then we display it and use the loading state to disable you from clicking on the button.

I'm making the signature of the callback take in an AIConfig object parameter, because we have function `clientConfigToAIConfig` within the editor pacakge: https://github.com/lastmile-ai/aiconfig/blob/c838856f36941b0796c8f12edcf846cc18ebdaa1/python/src/aiconfig/editor/client/src/shared/types.ts#L37

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

https://github.com/lastmile-ai/aiconfig/assets/151060367/123319cf-2e92-49e8-8f93-2d930a3b0ac7
rossdanlm pushed a commit that referenced this pull request Jan 29, 2024
If the download callback is defined (not for local editor or VSCode, but will be for Gradio), then we display it and use the loading state to disable you from clicking on the button.

I'm making the signature of the callback take in an AIConfig object parameter, because we have function `clientConfigToAIConfig` within the editor pacakge: https://github.com/lastmile-ai/aiconfig/blob/c838856f36941b0796c8f12edcf846cc18ebdaa1/python/src/aiconfig/editor/client/src/shared/types.ts#L37

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

https://github.com/lastmile-ai/aiconfig/assets/151060367/123319cf-2e92-49e8-8f93-2d930a3b0ac7
rossdanlm pushed a commit that referenced this pull request Jan 29, 2024
If the download callback is defined (not for local editor or VSCode, but will be for Gradio), then we display it and use the loading state to disable you from clicking on the button.

I'm making the signature of the callback take in an AIConfig object parameter, because we have function `clientConfigToAIConfig` within the editor pacakge: https://github.com/lastmile-ai/aiconfig/blob/c838856f36941b0796c8f12edcf846cc18ebdaa1/python/src/aiconfig/editor/client/src/shared/types.ts#L37

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

https://github.com/lastmile-ai/aiconfig/assets/151060367/123319cf-2e92-49e8-8f93-2d930a3b0ac7
rossdanlm added a commit that referenced this pull request Jan 29, 2024
Download Button [1/n]: Setup UI on the editor client



If the download callback is defined (not for local editor or VSCode, but
will be for Gradio), then we display it and use the loading state to
disable you from clicking on the button.

I'm making the signature of the callback take in an AIConfig object
parameter, because we have function `clientConfigToAIConfig` within the
editor pacakge:
https://github.com/lastmile-ai/aiconfig/blob/c838856f36941b0796c8f12edcf846cc18ebdaa1/python/src/aiconfig/editor/client/src/shared/types.ts#L37

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```


https://github.com/lastmile-ai/aiconfig/assets/151060367/123319cf-2e92-49e8-8f93-2d930a3b0ac7
rossdanlm pushed a commit that referenced this pull request Jan 30, 2024
I realized that after I moved `readOnly` check on entire group in #1032, I need to be able to still have the Download button for read-only mode so user can still download the AIConfig. We just need to make sure to define this endpoint in the lastMile repo

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

readOnly is true

readOnly is false
Rossdan Craig [email protected] added 2 commits January 30, 2024 00:45
I realized that after I moved `readOnly` check on entire group in #1032, I need to be able to still have the Download button for read-only mode so user can still download the AIConfig. We just need to make sure to define this endpoint in the lastMile repo

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

readOnly is true

<img width="1920" alt="Screenshot 2024-01-30 at 00 45 03" src="https://github.com/lastmile-ai/aiconfig/assets/151060367/356cd898-e3f2-430c-8153-a464b78a254b">

readOnly is false

<img width="1920" alt="Screenshot 2024-01-30 at 00 44 36" src="https://github.com/lastmile-ai/aiconfig/assets/151060367/d14ec7ee-8a10-49f1-b9d8-d4a5a2153b99">
TSIA, just adding code so we can mock the UI
rossdanlm pushed a commit that referenced this pull request Jan 30, 2024
I realized that after I moved `readOnly` check on entire group in #1032, I need to be able to still have the Download button for read-only mode so user can still download the AIConfig. We just need to make sure to define this endpoint in the lastMile repo

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

readOnly is true

<img width="1920" alt="Screenshot 2024-01-30 at 00 45 03" src="https://github.com/lastmile-ai/aiconfig/assets/151060367/356cd898-e3f2-430c-8153-a464b78a254b">

readOnly is false

<img width="1920" alt="Screenshot 2024-01-30 at 00 44 36" src="https://github.com/lastmile-ai/aiconfig/assets/151060367/d14ec7ee-8a10-49f1-b9d8-d4a5a2153b99">
rossdanlm added a commit that referenced this pull request Jan 30, 2024
Download Button [4/n]: Make this enabled for read-only mode




I realized that after I moved `readOnly` check on entire group in
#1032, I need to be able to
still have the Download button for read-only mode so user can still
download the AIConfig. We just need to make sure to define this endpoint
in the lastMile repo

## Test Plan
Rebase onto #1045

Go to `aiconfig/python/src/aiconfig/editor/client` and run this command:
```
rm -rf node_modules && yarn && yarn build
```

Then go to `aiconfig` dir and run this command:
```
aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json
parsers_path=./cookbooks/Gradio/hf_model_parsers.py
aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path
```

readOnly is true

<img width="1920" alt="Screenshot 2024-01-30 at 00 45 03"
src="https://github.com/lastmile-ai/aiconfig/assets/151060367/356cd898-e3f2-430c-8153-a464b78a254b">

readOnly is false

<img width="1920" alt="Screenshot 2024-01-30 at 00 44 36"
src="https://github.com/lastmile-ai/aiconfig/assets/151060367/d14ec7ee-8a10-49f1-b9d8-d4a5a2153b99">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant