Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,8 @@ import boto3, json, os
|
|
4 |
from dotenv import load_dotenv, find_dotenv
|
5 |
_ = load_dotenv(find_dotenv())
|
6 |
|
7 |
-
aws_access_key_id =
|
8 |
-
aws_secret_access_key =
|
9 |
|
10 |
config = {
|
11 |
"max_tokens_to_sample": 1000,
|
@@ -25,7 +25,9 @@ bedrock_runtime = boto3.client(
|
|
25 |
def invoke(prompt):
|
26 |
if (prompt == ""):
|
27 |
raise gr.Error("Prompt is required.")
|
28 |
-
|
|
|
|
|
29 |
completion = ""
|
30 |
|
31 |
try:
|
@@ -54,7 +56,7 @@ def invoke(prompt):
|
|
54 |
return completion
|
55 |
|
56 |
description = """<a href='https://www.gradio.app/'>Gradio</a> UI using the <a href='https://aws.amazon.com/bedrock/'>Amazon Bedrock</a> API
|
57 |
-
with <a href='https://www.anthropic.com/'>Anthropic</a> Claude 2 model.
|
58 |
|
59 |
gr.close_all()
|
60 |
|
|
|
4 |
from dotenv import load_dotenv, find_dotenv
|
5 |
_ = load_dotenv(find_dotenv())
|
6 |
|
7 |
+
aws_access_key_id = os.environ["AWS_ACCESS_KEY_ID"]
|
8 |
+
aws_secret_access_key = os.environ["AWS_SECRET_ACCESS_KEY"]
|
9 |
|
10 |
config = {
|
11 |
"max_tokens_to_sample": 1000,
|
|
|
25 |
def invoke(prompt):
|
26 |
if (prompt == ""):
|
27 |
raise gr.Error("Prompt is required.")
|
28 |
+
|
29 |
+
raise gr.Error("Clone and bring your own credentials.")
|
30 |
+
|
31 |
completion = ""
|
32 |
|
33 |
try:
|
|
|
56 |
return completion
|
57 |
|
58 |
description = """<a href='https://www.gradio.app/'>Gradio</a> UI using the <a href='https://aws.amazon.com/bedrock/'>Amazon Bedrock</a> API
|
59 |
+
with <a href='https://www.anthropic.com/'>Anthropic</a> Claude 2 model."""
|
60 |
|
61 |
gr.close_all()
|
62 |
|