Spaces:
No application file
No application file
Johan09033
commited on
Commit
·
e8ddf7b
1
Parent(s):
50ac637
Rename app.js to app.py
Browse files
app.js
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
async function query(data) {
|
2 |
-
const response = await fetch(
|
3 |
-
"https://api-inference.huggingface.co/models/OpenAssistant/oasst-sft-1-pythia-12b",
|
4 |
-
{
|
5 |
-
headers: { Authorization: "Bearer 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" },
|
6 |
-
method: "POST",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
|
3 |
+
API_URL = "https://api-inference.huggingface.co/models/OpenAssistant/oasst-sft-1-pythia-12b"
|
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 |
+
})
|