Skip to content

Commit

Permalink
Llama2 docs added
Browse files Browse the repository at this point in the history
  • Loading branch information
vara-bonthu committed Oct 27, 2023
1 parent 77cb5e7 commit 9f4786d
Show file tree
Hide file tree
Showing 14 changed files with 378 additions and 31 deletions.
10 changes: 3 additions & 7 deletions ai-ml/trainium-inferentia/examples/gradio-ui/gradio-app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ def text_generation(message, history):

full_output = response.text
# Removing the original question from the output
answer_only = full_output.replace(prompt, "", 1).strip()

# Remove any leading/trailing square brackets and double quotes
answer_only = answer_only.strip('["]')
answer_only = full_output.replace(prompt, "", 1).strip('["]?\n')

# Safety filter to remove harmful or inappropriate content
answer_only = filter_harmful_content(answer_only)

return f"<p>{answer_only}</p>" # Return text with preserved newlines
return answer_only
except requests.exceptions.RequestException as e:
# Handle any request exceptions (e.g., connection errors)
return f"AI: Error: {str(e)}"
Expand All @@ -46,7 +42,7 @@ def filter_harmful_content(text):
# Define the Gradio ChatInterface
chat_interface = gr.ChatInterface(
text_generation,
chatbot=gr.Chatbot(height=400, line_breaks=True),
chatbot=gr.Chatbot(line_breaks=True),
textbox=gr.Textbox(placeholder="Ask me a question", container=False, scale=7),
title="Llama2 AI Chat",
description="Ask me any question",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ spec:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: gradio-ingress
name: llama2-ingress
namespace: llama2
annotations:
nginx.ingress.kubernetes.io/rewrite-target: "/$1"
Expand Down
19 changes: 19 additions & 0 deletions website/docs/gen-ai/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
sidebar_position: 1
sidebar_label: Overview
---

# Gen AI on EKS

Welcome to Gen AI on Amazon Elastic Kubernetes Service (EKS), your gateway to harnessing the power of Large Language Models (LLMs) for a wide range of applications. This introduction page serves as your starting point to explore our offerings for Training, Fine-tuning, and Inference using various LLMs, including BERT-Large, Llama2, Stable Diffusion, and more.

## [Training](https://awslabs.github.io/docs/category/training-on-eks)
Are you ready to dive into the world of LLMs and train models for your specific needs? Discover our comprehensive Training resources to get started.

## [Fine-tuning](https://awslabs.github.io/docs/category/training-on-eks)
Fine-tuning LLMs is crucial for tailoring them to your specific tasks. Explore our Fine-tuning section to learn how to adapt LLMs to your unique requirements.

## [Inference](https://awslabs.github.io/docs/category/inference-on-eks)
Unlock the potential of LLMs for powerful inference tasks. Our Inference resources will guide you through deploying LLMs effectively.

Whether you're an experienced practitioner or new to the field, our Gen AI on EKS capabilities empower you to harness the latest advancements in language modeling. Dive into each section to begin your journey.
310 changes: 310 additions & 0 deletions website/docs/gen-ai/inference/Llama2.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions website/docs/gen-ai/inference/StableDiffusion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Stable Diffusion on EKS
sidebar_position: 2
---

:::info

COMING SOON

Please note that this section is currently a work in progress and will serve as a comprehensive collection of resources for running data and ML workloads on EKS.

:::
7 changes: 7 additions & 0 deletions website/docs/gen-ai/inference/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"label": "Inference on EKS",
"position": 1,
"link": {
"type": "generated-index"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions website/docs/gen-ai/training/BERT-Large.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: BERT-Large on EKS
sidebar_position: 1
---

:::info

COMING SOON

Please note that this section is currently a work in progress and will serve as a comprehensive collection of resources for running data and ML workloads on EKS.

:::
7 changes: 7 additions & 0 deletions website/docs/gen-ai/training/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"label": "Training on EKS",
"position": 2,
"link": {
"type": "generated-index"
}
}
15 changes: 0 additions & 15 deletions website/docs/workshop/intro.md

This file was deleted.

12 changes: 6 additions & 6 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ const config = {
position: 'left',
label: 'Introduction',
},
{
type: 'doc',
docId: 'gen-ai/index',
position: 'left',
label: 'Gen AI'
},
{
type: 'doc',
docId: 'blueprints/amazon-emr-on-eks/index',
Expand All @@ -79,12 +85,6 @@ const config = {
position: 'left',
label: 'Benchmarks'
},
{
type: 'doc',
docId: 'workshop/intro',
position: 'left',
label: 'Workshop'
},
{
type: 'doc',
docId: 'resources/intro',
Expand Down
3 changes: 1 addition & 2 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
// docs: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
genai: [{type: 'autogenerated', dirName: 'gen-ai'}],
blueprints: [{type: 'autogenerated', dirName: 'blueprints'}],
bestpractices: [{type: 'autogenerated', dirName: 'bestpractices'}],
benchmarks: [{type: 'autogenerated', dirName: 'benchmarks'}],
workshop: [{type: 'autogenerated', dirName: 'workshop'}],
resources: [{type: 'autogenerated', dirName: 'resources'}],
};

Expand Down

0 comments on commit 9f4786d

Please sign in to comment.