Spaces:
Running
Running
github-actions[bot]
commited on
Commit
·
7bea42e
1
Parent(s):
8d398ee
Sync turing folder from GitHub
Browse files- turing/api/demo.py +8 -7
turing/api/demo.py
CHANGED
|
@@ -20,8 +20,8 @@ FEEDBACK_FILE = "reports/feedback/feedback_data.csv"
|
|
| 20 |
|
| 21 |
LABELS_MAP = {
|
| 22 |
"java": ["summary", "Ownership", "Expand", "usage", "Pointer", "deprecation", "rational"],
|
| 23 |
-
"python": ["Usage", "Parameters", "
|
| 24 |
-
"pharo": ["
|
| 25 |
}
|
| 26 |
|
| 27 |
# --- CSS ---
|
|
@@ -207,11 +207,12 @@ def create_demo(inference_engine: ModelInference):
|
|
| 207 |
)
|
| 208 |
|
| 209 |
if labels and len(labels) > 0:
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
|
|
|
| 215 |
|
| 216 |
return "Unknown: Low confidence."
|
| 217 |
|
|
|
|
| 20 |
|
| 21 |
LABELS_MAP = {
|
| 22 |
"java": ["summary", "Ownership", "Expand", "usage", "Pointer", "deprecation", "rational"],
|
| 23 |
+
"python": ["Usage", "Parameters", "Development Notes", "Expand", "Summary"],
|
| 24 |
+
"pharo": ["Key implementation points", "Example", "Responsibilities", "Intent", "Key messages", "Collaborators"],
|
| 25 |
}
|
| 26 |
|
| 27 |
# --- CSS ---
|
|
|
|
| 207 |
)
|
| 208 |
|
| 209 |
if labels and len(labels) > 0:
|
| 210 |
+
predicted_labels = labels[0]
|
| 211 |
+
|
| 212 |
+
if isinstance(predicted_labels, list):
|
| 213 |
+
return ", ".join(str(lab) for lab in predicted_labels)
|
| 214 |
+
|
| 215 |
+
return str(predicted_labels)
|
| 216 |
|
| 217 |
return "Unknown: Low confidence."
|
| 218 |
|