Spaces:
Sleeping
Sleeping
Upload backend.py with huggingface_hub
Browse files- backend.py +4 -0
backend.py
CHANGED
|
@@ -159,6 +159,8 @@ class ParsedError:
|
|
| 159 |
class ParsedSuggestion:
|
| 160 |
description: str
|
| 161 |
category: str
|
|
|
|
|
|
|
| 162 |
|
| 163 |
|
| 164 |
@dataclass
|
|
@@ -235,6 +237,8 @@ def _parse_to_result(model_label: str, raw: str, latency: float) -> ModelResult:
|
|
| 235 |
ParsedSuggestion(
|
| 236 |
description=s.get("description", ""),
|
| 237 |
category=s.get("category", "other"),
|
|
|
|
|
|
|
| 238 |
)
|
| 239 |
for s in parsed.get("suggestions", [])
|
| 240 |
]
|
|
|
|
| 159 |
class ParsedSuggestion:
|
| 160 |
description: str
|
| 161 |
category: str
|
| 162 |
+
quote: str = ""
|
| 163 |
+
suggested_rewrite: str = ""
|
| 164 |
|
| 165 |
|
| 166 |
@dataclass
|
|
|
|
| 237 |
ParsedSuggestion(
|
| 238 |
description=s.get("description", ""),
|
| 239 |
category=s.get("category", "other"),
|
| 240 |
+
quote=s.get("quote", ""),
|
| 241 |
+
suggested_rewrite=s.get("suggested_rewrite", ""),
|
| 242 |
)
|
| 243 |
for s in parsed.get("suggestions", [])
|
| 244 |
]
|