Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,19 +8,6 @@ BOT_USERNAME = "@DiscussionBot"
|
|
| 8 |
INFERENCE_URL = "https://api-inference.huggingface.co/models/bigscience/bloom"
|
| 9 |
PROMPT = "Pretend you're a robot responding to machine learning discussions and reply to the following comment :\n"
|
| 10 |
|
| 11 |
-
@app.get("/")
|
| 12 |
-
async def root(request: Request) -> Dict[str, Any]:
|
| 13 |
-
"""
|
| 14 |
-
Gère les requêtes GET et renvoie les détails de la requête sous forme JSON.
|
| 15 |
-
"""
|
| 16 |
-
request_details = {
|
| 17 |
-
"method": request.method,
|
| 18 |
-
"headers": dict(request.headers),
|
| 19 |
-
"query_params": dict(request.query_params),
|
| 20 |
-
"message": "Webhook server is running. Use POST to interact with the bot."
|
| 21 |
-
}
|
| 22 |
-
print(f"GET request received: {request_details}")
|
| 23 |
-
return request_details
|
| 24 |
|
| 25 |
@app.post("/")
|
| 26 |
async def webhook(request: Request) -> Dict[str, Any]:
|
|
|
|
| 8 |
INFERENCE_URL = "https://api-inference.huggingface.co/models/bigscience/bloom"
|
| 9 |
PROMPT = "Pretend you're a robot responding to machine learning discussions and reply to the following comment :\n"
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
@app.post("/")
|
| 13 |
async def webhook(request: Request) -> Dict[str, Any]:
|