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

Share Button [3/n]: Upload AIConfig file to S3 #1037

Closed
wants to merge 4 commits into from
Closed

Conversation

rossdanlm
Copy link
Contributor

@rossdanlm rossdanlm commented Jan 26, 2024

Share Button [3/n]: Upload AIConfig file to S3

The first part of the share functionality is uploading it to S3. Next PR going to pass in this S3 link into the api/aiconfig/upload path, and the PR after that will create a UI dialog on return that displays the URI.

I also created a helper function convertClientAIConfigToAIConfig to get the AIConfig format without the client _ui fields

Test Plan

Check that the S3 loads when you click the button

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
0279c795-b83e-4a9a-9b93-e0c4b6522cbf.mp4

Stack created with Sapling. Best reviewed with ReviewStack.

Rossdan Craig rossdan@lastmileai.dev added 3 commits January 25, 2024 17:42
Doesn't do anything when you click it now, but just setting up the UI and tooltip. Will add upload feature next PR

## Test Plan
Run these commands from the `aiconfig` dir:
```bash
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
```

<img width="1512" alt="Screenshot 2024-01-25 at 15 58 42" src="https://github.com/lastmile-ai/aiconfig/assets/151060367/6f414df7-dcf3-4b58-beed-c4fc3f7c2968">
Doing this makes it easier to manage rather than gating each one individually

## Test Plan
No functional changes

ReadOnly mode

<img width="1512" alt="Screenshot 2024-01-25 at 16 03 30" src="https://github.com/lastmile-ai/aiconfig/assets/151060367/3493b525-e943-46fe-805d-3424af206bae">


Regular mode (with share button shown)

<img width="1512" alt="Screenshot 2024-01-25 at 16 04 06" src="https://github.com/lastmile-ai/aiconfig/assets/151060367/fc7a86c2-8efb-4190-afe9-870a15e93f46">
Going to re-use this next PR for uploading AIConfig files to S3

## Test Plan
No functional changes, make sure that uploading files still works for ASR and Image 2 text

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/7a5141f1-bb1b-496c-b039-724a8eeb11dd
The first part of the share functionality is uploading it to S3. Next PR going to pass in this S3 link into the `api/aiconfig/upload` path, and the PR after that will create a UI dialog on return that displays the URI.

I also created a helper function `convertClientAIConfigToAIConfig` to get the AIConfig format without the client `_ui` fields

## Test Plan
Check that the S3 loads when you click the button

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/e63b73f0-845f-446f-9c6b-4d3e737dec29
@rossdanlm rossdanlm marked this pull request as ready for review January 26, 2024 00:56
rossdanlm added a commit that referenced this pull request Jan 26, 2024
Share button [1/n]: Create button UI



Doesn't do anything when you click it now, but just setting up the UI
and tooltip. Will add upload feature next PR

## Test Plan
Run these commands from the `aiconfig` dir:
```bash
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
```

<img width="1512" alt="Screenshot 2024-01-25 at 15 58 42"
src="https://github.com/lastmile-ai/aiconfig/assets/151060367/6f414df7-dcf3-4b58-beed-c4fc3f7c2968">

---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/1031).
* #1037
* #1035
* #1032
* __->__ #1031
rossdanlm added a commit that referenced this pull request Jan 26, 2024
…#1032)

Move !readOnly check to entire header grouping at top for all buttons


Doing this makes it easier to manage rather than gating each one
individually

## Test Plan
No functional changes

ReadOnly mode

<img width="1512" alt="Screenshot 2024-01-25 at 16 03 30"
src="https://github.com/lastmile-ai/aiconfig/assets/151060367/3493b525-e943-46fe-805d-3424af206bae">


Regular mode (with share button shown)

<img width="1512" alt="Screenshot 2024-01-25 at 16 04 06"
src="https://github.com/lastmile-ai/aiconfig/assets/151060367/fc7a86c2-8efb-4190-afe9-870a15e93f46">

---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/1032).
* #1037
* #1035
* __->__ #1032
* #1031
@@ -47,3 +47,21 @@ export function getModelSettingsStream(

return undefined;
}

export function convertClientAIConfigToAIConfig(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have this as clientConfigToAIConfig in the types (just have it colocated with the definitions of ClientAIConfig, etc.)

@rossdanlm rossdanlm closed this Jan 26, 2024
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

2 participants