-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from build-on-aws/jossai
Jossai
- Loading branch information
Showing
30 changed files
with
15,503 additions
and
166 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
STEPS TO SETUP LAMBDA FUNCTION FOR ACTION GROUP: | ||
|
||
1. Update credentials via aws configure | ||
|
||
2. Install Serverless Framework: | ||
npm install -g serverless (REFER BELOW IF AN ERROR OCCURS HERE) | ||
|
||
3. Create a new service/project with Python template: | ||
serverless create --template aws-python3 --path infer-models | ||
cd infer-models | ||
|
||
4. Then install the serverless-python-requirements plugin: | ||
npm install serverless-python-requirements --save-dev | ||
|
||
5. Deploy the Lambda function: | ||
npx sls deploy | ||
|
||
|
||
6. View logs of a deployed function: | ||
serverless logs --function inferModel | ||
|
||
|
||
EXAMPLE PROMPT: | ||
use model meta.llama3-8b-instruct-v1:0 and Do sentiment analysis with nuances in reasoning of the following: Recently, I purchased a new smartphone from a well-known electronics brand, and I'm thoroughly disappointed. The phone frequently freezes, the battery life is terrible, and the customer service was unhelpful when I reached out for support. I expected much better quality and service based on their reputation. | ||
|
||
|
||
|
||
|
||
|
||
------------------------ | ||
|
||
IF YOU GET A NODE IUNSUPPORTED ENGINE ERROR when running "npm install -g serverless", FOLLOW THE BELOW INSTRUCTIONS" | ||
|
||
The error indicates that your current Node.js version is not supported by the version of Serverless Framework you are trying to install. Additionally, there seems to be a filesystem issue during the installation. | ||
|
||
### Steps to Resolve: | ||
|
||
1. **Upgrade Node.js**: | ||
Upgrade Node.js to a version that meets the requirement of `>=18.0.0`. | ||
|
||
2. **Clear NPM Cache and Reinstall Serverless**: | ||
Clear the npm cache and then reinstall the Serverless Framework. | ||
|
||
3. **Remove Conflicting Directories**: | ||
Manually remove any existing conflicting directories before reinstalling. | ||
|
||
### Step-by-Step Instructions: | ||
|
||
#### 1. Upgrade Node.js | ||
First, upgrade Node.js to version 18.x or later. You can use `nvm` (Node Version Manager) to manage Node.js versions: | ||
|
||
```bash | ||
# Install nvm if not already installed | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash | ||
source ~/.nvm/nvm.sh | ||
|
||
# Install Node.js version 18.x | ||
nvm install 18 | ||
nvm use 18 | ||
|
||
# Verify the Node.js version | ||
node -v | ||
``` | ||
|
||
#### 2. Clear NPM Cache and Reinstall Serverless | ||
|
||
Clear the npm cache to ensure there are no residual files causing issues: | ||
|
||
```bash | ||
npm cache clean -f | ||
``` | ||
|
||
Then, attempt to reinstall the Serverless Framework globally: | ||
|
||
```bash | ||
npm install -g serverless | ||
``` | ||
|
||
#### 3. Remove Conflicting Directories Manually | ||
|
||
If the installation fails again with a directory not empty error, you may need to manually remove the conflicting directory: | ||
|
||
```bash | ||
# Manually remove the conflicting directory | ||
rm -rf /Users/jossai/Desktop/TechNotes/Testing/dockertest/vendor/node_modules/lib/node_modules/serverless | ||
|
||
# Attempt to reinstall Serverless Framework | ||
npm install -g serverless | ||
``` | ||
|
||
#### 4. Run Locally Installed Version Using `npx` | ||
|
||
Alternatively, you can run the locally installed version of Serverless Framework using `npx`: | ||
|
||
```bash | ||
npx serverless deploy | ||
``` | ||
|
||
### Summary of Commands | ||
|
||
```bash | ||
# Install nvm if not already installed | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash | ||
source ~/.nvm/nvm.sh | ||
|
||
# Install Node.js version 18.x | ||
nvm install 18 | ||
nvm use 18 | ||
|
||
# Verify Node.js version | ||
node -v | ||
|
||
# Clear npm cache | ||
npm cache clean -f | ||
|
||
# Manually remove conflicting directory if necessary | ||
rm -rf /Users/jossai/Desktop/TechNotes/Testing/dockertest/vendor/node_modules/lib/node_modules/serverless | ||
|
||
# Install Serverless Framework globally | ||
npm install -g serverless | ||
|
||
# Use npx to run the locally installed version if needed | ||
npx serverless deploy | ||
``` | ||
|
||
These steps should help resolve the issues with installing and using the Serverless Framework. |
Binary file removed
BIN
-43.1 KB
arm64/4f8a638371415bdc9937de12537cd1b4f61c2c636745a2eabfa4ad73d260764d.tar.xz
Binary file not shown.
Binary file removed
BIN
-76.6 MB
arm64/5b66d183cd8e9403ccc01d47764023a9819250f035d3cd8b6a16376a2225ba52.tar.xz
Binary file not shown.
Binary file removed
BIN
-464 Bytes
arm64/5c6fd1ee194a253e4400d19bb1ae7a718aa75ae33dc2ed2a15a5e3afc48cbd92.tar.xz
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-21.3 MB
arm64/aea09d27759030284de0c701d55ca6feb2966bb1cb825c0642182329d42eb5a7.tar.xz
Binary file not shown.
Binary file removed
BIN
-1.63 MB
arm64/bdd81f062c835848c8154c694401427f8404a6f07d6e24365c2c1c4cee7da993.tar.xz
Binary file not shown.
Binary file removed
BIN
-13.6 KB
arm64/c0fd6400d81e9f92cbec5f956db70aa916ca5b7f217439e798b0e347897a14b4.tar.xz
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
0
lambda_function.py → infer-models/handler.py
100755 → 100644
File renamed without changes.
Oops, something went wrong.