Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
|
| 3 |
+
API_URL = "https://api-inference.huggingface.co/models/AdaptLLM/law-LLM"
|
| 4 |
+
API_TOKEN="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"
|
| 5 |
+
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def query(payload):
|
| 9 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
| 10 |
+
return response.json()
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
output = query({
|
| 14 |
+
"inputs": "Can",
|
| 15 |
+
})
|
| 16 |
+
print(output)
|