Skip to content

Commit

Permalink
feat: Add automated validation
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-marion committed Jan 6, 2025
1 parent b9ba6e3 commit 49e887c
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 40 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/e2e-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: End to end verification
on:
push:
branches:
- main
- feat_workflow
jobs:
validation:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
## the following creates an ARN based on the values entered into github secrets
role-to-assume: arn:aws:iam::${{ secrets.PIPELINE_AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_GITHUB_ACTIONS_ROLE }}
role-session-name: github-action
- name: Validate
run: |
executionId=$(aws codepipeline start-pipeline-execution --name ${{ secrets.PIPELINE_NAME }}-${{ github.head_ref }} --region ${{ secrets.PIPELINE_AWS_REGION }} --query "pipelineExecutionId" --output text)
while true; do
status=$(aws codepipeline get-pipeline-execution --pipeline-name ${{ secrets.PIPELINE_NAME }}-${{ github.head_ref }} --region ${{ secrets.PIPELINE_AWS_REGION }} --pipeline-execution-id $executionId --query "pipelineExecution.status" --output text)
echo "Pipeline status: $status"
if [[ "$status" == "Failed" ]]; then
echo "Pipeline failed."
exit 1
fi
if [[ "$status" != "InProgress" ]]; then
break
fi
sleep 30
done
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ class MultiModalModelBase:
@abstractmethod
def handle_run(
self, input: dict, model_kwargs: dict, files: Optional[list] = None
) -> str:
...
) -> str: ...

@abstractmethod
def on_llm_new_token(self, user_id: str, session_id: str, chunk: str) -> None:
...
def on_llm_new_token(self, user_id: str, session_id: str, chunk: str) -> None: ...

def upload_file_message(self, content: bytes, file_type: str):
key = str(uuid.uuid4())
Expand Down Expand Up @@ -133,12 +131,10 @@ def clean_prompt(self, input: dict) -> str:
return json.dumps(input)

@abstractmethod
def generate_image(self, input: dict, model_kwargs: dict):
...
def generate_image(self, input: dict, model_kwargs: dict): ...

@abstractmethod
def generate_video(self, input: dict, model_kwargs: dict):
...
def generate_video(self, input: dict, model_kwargs: dict): ...

def converse(self, input: dict, model_kwargs: dict):
logger.info("Incoming request for nova", model_kwargs=model_kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def generate_image(
"width": 1280,
"height": 768,
"cfgScale": 7.0,
"seed": model_kwargs.get("seed", randint(0, 2147483646)), # nosec B311
"seed": model_kwargs.get("seed", randint(0, 2147483646)), # fmt: skip # noqa # nosec B311 # NOSONAR
},
}
logger.info(
Expand Down Expand Up @@ -236,7 +236,7 @@ def generate_video(
"durationSeconds": 6,
"fps": 24,
"dimension": "1280x720",
"seed": model_kwargs.get("seed", randint(0, 2147483646)), # nosec B311
"seed": model_kwargs.get("seed", randint(0, 2147483646)), # fmt: skip # noqa # nosec B311 # NOSONAR
},
}
logger.info("Model input", model_input=model_input)
Expand Down
6 changes: 3 additions & 3 deletions lib/user-interface/react-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -215,30 +215,30 @@ export default function ChatMessage(props: ChatMessageProps) {
)
}
>
{props.message.content.length > 0 && (
<div className={styles.btn_chabot_message_copy}>
<Popover
data-locator="copy-clipboard"
size="medium"
position="top"
triggerType="custom"
dismissButton={false}
content={
<StatusIndicator type="success">
Copied to clipboard
</StatusIndicator>
}
>
<Button
variant="inline-icon"
iconName="copy"
onClick={() => {
navigator.clipboard.writeText(props.message.content);
}}
/>
</Popover>
</div>
)}
{props.message.content.length > 0 && (
<div className={styles.btn_chabot_message_copy}>
<Popover
data-locator="copy-clipboard"
size="medium"
position="top"
triggerType="custom"
dismissButton={false}
content={
<StatusIndicator type="success">
Copied to clipboard
</StatusIndicator>
}
>
<Button
variant="inline-icon"
iconName="copy"
onClick={() => {
navigator.clipboard.writeText(props.message.content);
}}
/>
</Popover>
</div>
)}
{loading ||
(content.length === 0 && !processingAsyncFiles && !files.length) ? (
<Box>
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 49e887c

Please sign in to comment.