bstraehle commited on
Commit
adbeb82
1 Parent(s): 801487f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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 = "BringYourOwn" #os.environ["AWS_ACCESS_KEY_ID"]
8
- aws_secret_access_key = "BringYourOwn" #os.environ["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. Clone and bring your own credentials."""
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