Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
import streamlit as st
|
3 |
+
import os
|
4 |
+
|
5 |
+
API_URL = https://qe55p8afio98s0u3.us-east-1.aws.endpoints.huggingface.cloud
|
6 |
+
API_KEY = os.getenv('API_KEY')
|
7 |
+
|
8 |
+
headers = {
|
9 |
+
"Authorization": "Bearer {API_KEY}",
|
10 |
+
"Content-Type": "application/json"
|
11 |
+
}
|
12 |
+
|
13 |
+
def query(payload):
|
14 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
15 |
+
return response.json()
|
16 |
+
|
17 |
+
output = query({
|
18 |
+
"inputs": "Can you please let us know more details about your ",
|
19 |
+
})
|