Ganesh Karbhari commited on
Commit
8b16f47
1 Parent(s): 09bd95d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -227,6 +227,9 @@
227
 
228
  import gradio as gr
229
  import boto3
 
 
 
230
  client = boto3.client(service_name='bedrock-runtime',region_name='us-east-1',aws_access_key_id=access_key_id,aws_secret_access_key=secret_access_key)
231
 
232
  prompt = """
@@ -251,6 +254,8 @@ def generate(
251
  temperature=temperature,
252
  max_gen_len=max_gen_len,
253
  top_p=top_p)
 
 
254
 
255
  conversation = ConversationChain(
256
  prompt=prompt_temp,
 
227
 
228
  import gradio as gr
229
  import boto3
230
+ import os
231
+ access_key_id = os.environ['aws_access_key_id']
232
+ secret_access_key = os.environ['aws_secret_access_key']
233
  client = boto3.client(service_name='bedrock-runtime',region_name='us-east-1',aws_access_key_id=access_key_id,aws_secret_access_key=secret_access_key)
234
 
235
  prompt = """
 
254
  temperature=temperature,
255
  max_gen_len=max_gen_len,
256
  top_p=top_p)
257
+
258
+ llm = Bedrock(model_id="meta.llama3-8b-instruct-v1:0",model_kwargs=generate_kwargs,client=bedrock_runtime)
259
 
260
  conversation = ConversationChain(
261
  prompt=prompt_temp,