Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -88,14 +88,14 @@ def ask_llm(prompt, byte_image):
|
|
88 |
}
|
89 |
}
|
90 |
#response = requests.post(url, json=payload, headers=headers)
|
91 |
-
|
92 |
EndpointName=sm_endpoint_name,
|
93 |
Body=json.dumps(payload),
|
94 |
ContentType="application/json",
|
95 |
)
|
96 |
|
97 |
#return response.text
|
98 |
-
return
|
99 |
|
100 |
def app():
|
101 |
st.markdown("---")
|
|
|
88 |
}
|
89 |
}
|
90 |
#response = requests.post(url, json=payload, headers=headers)
|
91 |
+
response_model = smr.invoke_endpoint(
|
92 |
EndpointName=sm_endpoint_name,
|
93 |
Body=json.dumps(payload),
|
94 |
ContentType="application/json",
|
95 |
)
|
96 |
|
97 |
#return response.text
|
98 |
+
return response_model['Body'].read().decode('utf8')
|
99 |
|
100 |
def app():
|
101 |
st.markdown("---")
|