Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- .pytest_cache/v/cache/nodeids +1 -0
- packages.txt +1 -0
- requirements.txt +2 -0
- tests/test_interpretation.py +13 -0
.pytest_cache/v/cache/nodeids
CHANGED
|
@@ -6,6 +6,7 @@
|
|
| 6 |
"tests/test_interpretation.py::test_raises_clear_error_on_malformed_json",
|
| 7 |
"tests/test_interpretation.py::test_raises_when_fields_missing",
|
| 8 |
"tests/test_interpretation.py::test_repairs_json_escaped_json",
|
|
|
|
| 9 |
"tests/test_interpretation.py::test_strips_markdown_code_fences",
|
| 10 |
"tests/test_interpretation.py::test_tolerates_literal_newlines_inside_string_values",
|
| 11 |
"tests/test_motion_and_registry.py::test_explicit_mode_wins",
|
|
|
|
| 6 |
"tests/test_interpretation.py::test_raises_clear_error_on_malformed_json",
|
| 7 |
"tests/test_interpretation.py::test_raises_when_fields_missing",
|
| 8 |
"tests/test_interpretation.py::test_repairs_json_escaped_json",
|
| 9 |
+
"tests/test_interpretation.py::test_rescues_truncated_unterminated_json",
|
| 10 |
"tests/test_interpretation.py::test_strips_markdown_code_fences",
|
| 11 |
"tests/test_interpretation.py::test_tolerates_literal_newlines_inside_string_values",
|
| 12 |
"tests/test_motion_and_registry.py::test_explicit_mode_wins",
|
packages.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
ffmpeg
|
requirements.txt
CHANGED
|
@@ -15,6 +15,8 @@ imageio-ffmpeg
|
|
| 15 |
gradio_client
|
| 16 |
# ACE-Step's actual inference deps (its own requirements over-pin):
|
| 17 |
torchaudio
|
|
|
|
|
|
|
| 18 |
torchvision
|
| 19 |
librosa
|
| 20 |
loguru
|
|
|
|
| 15 |
gradio_client
|
| 16 |
# ACE-Step's actual inference deps (its own requirements over-pin):
|
| 17 |
torchaudio
|
| 18 |
+
# torchaudio>=2.9 delegates save() to torchcodec (needs ffmpeg, see packages.txt)
|
| 19 |
+
torchcodec
|
| 20 |
torchvision
|
| 21 |
librosa
|
| 22 |
loguru
|
tests/test_interpretation.py
CHANGED
|
@@ -56,6 +56,19 @@ def test_repairs_json_escaped_json():
|
|
| 56 |
assert out.brief_en == "A painting of a distant scene."
|
| 57 |
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
def test_tolerates_literal_newlines_inside_string_values():
|
| 60 |
# Seen live from MiniCPM on ZeroGPU: valid-looking JSON with real newline
|
| 61 |
# characters inside the string values (invalid in strict JSON).
|
|
|
|
| 56 |
assert out.brief_en == "A painting of a distant scene."
|
| 57 |
|
| 58 |
|
| 59 |
+
def test_rescues_truncated_unterminated_json():
|
| 60 |
+
# Verbatim from ZeroGPU: escaped JSON that stops before the closing brace.
|
| 61 |
+
text = (
|
| 62 |
+
'{\\n \\"understandingZh\\": \\"这首诗描绘了筝弦的悠扬与狂风的动荡。\\",'
|
| 63 |
+
'\\n \\"briefEn\\": \\"a painting only — featuring a distant journey,'
|
| 64 |
+
' the scene filled with depth and movement.\\"'
|
| 65 |
+
)
|
| 66 |
+
out = parse_interpretation(text)
|
| 67 |
+
assert out.understanding_zh == "这首诗描绘了筝弦的悠扬与狂风的动荡。"
|
| 68 |
+
assert out.brief_en.startswith("a painting only")
|
| 69 |
+
assert out.brief_en.endswith("movement.")
|
| 70 |
+
|
| 71 |
+
|
| 72 |
def test_tolerates_literal_newlines_inside_string_values():
|
| 73 |
# Seen live from MiniCPM on ZeroGPU: valid-looking JSON with real newline
|
| 74 |
# characters inside the string values (invalid in strict JSON).
|