Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,7 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
def
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
# Create the webhooks server
|
| 9 |
-
webhooks_server = WebhooksServer(webhook_secret="your_secret_key")
|
| 10 |
-
|
| 11 |
-
# Add your webhook handler to the server
|
| 12 |
-
webhooks_server.add_webhook("/webhook-endpoint")
|
| 13 |
-
|
| 14 |
-
# Run the server
|
| 15 |
-
webhooks_server.run()
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
API_URL = "https://api-inference.huggingface.co/models/gpt2"
|
| 3 |
+
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 4 |
+
def query(payload):
|
| 5 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
| 6 |
+
return response.json()
|
| 7 |
+
data = query("Can you please let us know more details about your ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|