Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,12 @@
|
|
1 |
-
|
2 |
-
const response = await fetch(
|
3 |
-
"https://api-inference.huggingface.co/models/bigscience/bloom",
|
4 |
-
{
|
5 |
-
headers: { Authorization: "Bhf_RryCjUQHSqwobWXNyvzUWdEYdHxizZDLZlxxxxxx" },
|
6 |
-
method: "POST",
|
7 |
-
body: JSON.stringify(data),
|
8 |
-
}
|
9 |
-
);
|
10 |
-
const result = await response.json();
|
11 |
-
return result;
|
12 |
-
}
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
API_URL = "https://api-inference.huggingface.co/models/bigscience/bloom"
|
4 |
+
headers = {"Authorization": "Bearer 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"}
|
5 |
+
|
6 |
+
def query(payload):
|
7 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
8 |
+
return response.json()
|
9 |
+
|
10 |
+
output = query({
|
11 |
+
"inputs": "Can you please let us know more details about your ",
|
12 |
+
})
|