Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ bedrock_runtime = boto3.client(
|
|
14 |
region_name="us-west-2"
|
15 |
)
|
16 |
|
17 |
-
def
|
18 |
args = {
|
19 |
"modelId": "anthropic.claude-v2",
|
20 |
"contentType": "application/json",
|
@@ -26,7 +26,7 @@ def complete(prompt):
|
|
26 |
return response_body['completion']
|
27 |
|
28 |
gr.close_all()
|
29 |
-
demo = gr.Interface(fn=
|
30 |
inputs=[gr.Textbox(label="Prompt", lines=1)],
|
31 |
outputs=[gr.Textbox(label="Completion", lines=1)],
|
32 |
title="Generative AI - Text Generation",
|
|
|
14 |
region_name="us-west-2"
|
15 |
)
|
16 |
|
17 |
+
def invoke(prompt):
|
18 |
args = {
|
19 |
"modelId": "anthropic.claude-v2",
|
20 |
"contentType": "application/json",
|
|
|
26 |
return response_body['completion']
|
27 |
|
28 |
gr.close_all()
|
29 |
+
demo = gr.Interface(fn=invoke,
|
30 |
inputs=[gr.Textbox(label="Prompt", lines=1)],
|
31 |
outputs=[gr.Textbox(label="Completion", lines=1)],
|
32 |
title="Generative AI - Text Generation",
|