Spaces:
Running
Running
avsolatorio
commited on
Commit
•
aadf93b
1
Parent(s):
78d1da2
Add logging
Browse filesSigned-off-by: Aivin V. Solatorio <avsolatorio@gmail.com>
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import os
|
|
|
2 |
import gradio as gr
|
3 |
import pycountry
|
|
|
4 |
from typing import Dict, Union
|
5 |
from gliner import GLiNER
|
6 |
|
@@ -51,7 +53,10 @@ def parse_query(query: str, labels: Union[str, list], threshold: float = 0.3, ne
|
|
51 |
else:
|
52 |
entities.append(entity)
|
53 |
|
54 |
-
|
|
|
|
|
|
|
55 |
|
56 |
|
57 |
|
|
|
1 |
import os
|
2 |
+
import json
|
3 |
import gradio as gr
|
4 |
import pycountry
|
5 |
+
from datetime import datetime
|
6 |
from typing import Dict, Union
|
7 |
from gliner import GLiNER
|
8 |
|
|
|
53 |
else:
|
54 |
entities.append(entity)
|
55 |
|
56 |
+
payload = {"query": query, "entities": entities}
|
57 |
+
print(f"{datetime.now()} :: {json.dumps(payload)}\n")
|
58 |
+
|
59 |
+
return payload
|
60 |
|
61 |
|
62 |
|