Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -119,7 +119,7 @@ def generate_code(task: str, user_input: str) -> str:
|
|
| 119 |
skip_special_tokens=True,
|
| 120 |
)
|
| 121 |
|
| 122 |
-
code =
|
| 123 |
|
| 124 |
if not code:
|
| 125 |
return "The model returned an empty response. Please try again."
|
|
@@ -239,6 +239,7 @@ into equivalent C# using a fine-tuned Qwen2.5-Coder model.
|
|
| 239 |
user_input,
|
| 240 |
],
|
| 241 |
)
|
|
|
|
| 242 |
def _clean_csharp_output(code: str) -> str:
|
| 243 |
"""
|
| 244 |
Remove spurious `virtual` / `override` modifiers the model adds to bare
|
|
|
|
| 119 |
skip_special_tokens=True,
|
| 120 |
)
|
| 121 |
|
| 122 |
+
code = _clean_csharp_output(generated_text)
|
| 123 |
|
| 124 |
if not code:
|
| 125 |
return "The model returned an empty response. Please try again."
|
|
|
|
| 239 |
user_input,
|
| 240 |
],
|
| 241 |
)
|
| 242 |
+
|
| 243 |
def _clean_csharp_output(code: str) -> str:
|
| 244 |
"""
|
| 245 |
Remove spurious `virtual` / `override` modifiers the model adds to bare
|