Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yeukfei02/generative-ai
generative-ai
https://github.com/yeukfei02/generative-ai
aws-apigateway aws-cdk aws-lambda bedrock cdk generative-ai python serverless stable-diffusion streamlit text-to-image text-to-text
Last synced: about 2 months ago
JSON representation
generative-ai
- Host: GitHub
- URL: https://github.com/yeukfei02/generative-ai
- Owner: yeukfei02
- License: mit
- Created: 2024-01-28T13:26:57.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-19T09:01:18.000Z (5 months ago)
- Last Synced: 2024-08-20T09:33:47.344Z (5 months ago)
- Topics: aws-apigateway, aws-cdk, aws-lambda, bedrock, cdk, generative-ai, python, serverless, stable-diffusion, streamlit, text-to-image, text-to-text
- Language: Python
- Homepage:
- Size: 2.69 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# generative-ai
This project intends to use aws cdk with aws bedrock to make API with generative ai, there are two API for `text-to-text` and `text-to-image`
The model uses `amazon titan text express v1`, `meta llama3 8b-instruct v1.0` and `stable diffusion XL v1.0`
Web ui uses streamlit
documentation:
api:
grammarly api url:
best-deal api url:
ideal-girl api url:
get-ideal-girls api url:
web:
grammarly web url:
best-deal web url:
ideal-girl web url:
ideal-girl-listing web url:
## Requirement
- install python (v3.12.1)
- install cdk-cliThe cdk.json file tells the CDK Toolkit how to execute your app.
## Testing and run
```zsh
// create virtualenv
$ python -m venv .venv// activate virtualenv
$ source .venv/bin/activate// install dependencies
$ pip install -r requirements.txt
$ pip install -r requirements-dev.txt// install lambda layer dependencies
$ cd lambda/layer/python
$ pip install -r requirements.txt// run test case
$ pytest
``````zsh
// copy .env file
$ cp .env.sample .env// list all stacks in the app
$ cdk ls// deploys the CDK toolkit stack into an AWS environment
$ cdk bootstrap// compare deployed stack with current state
$ cdk diff// synthesize the CloudFormation template
$ cdk synth// deploy specific stack to your default AWS account/region
$ cdk deploy// deploy all stack
$ cdk deploy --all// destroy specific stack
$ cdk destroy// destroy all stack
$ cdk destroy --all// check more command
$ cdk --help
``````zsh
// install dependencies
$ cd web
$ pip install -r requirements.txt// open grammarly web
$ streamlit run grammarly.py// open best_deal web
$ streamlit run best_deal.py// open ideal girl web
$ streamlit run ideal_girl.py// open ideal girl listing web
$ streamlit run ideal_girl_listing.py
```