summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpks <pks@pks.rocks>2025-12-01 23:19:44 +0100
committerpks <pks@pks.rocks>2025-12-01 23:19:44 +0100
commit0670bfe198e12cb25800cfae48677d90ea978cf2 (patch)
tree8f89b37e2dea075043a4ade25cf01cecbf954c3e
parentab9bf07297fd3edf7d894ebf92de175d1246a5da (diff)
WIP
-rwxr-xr-xinference.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/inference.py b/inference.py
index 351ffd9..69ab33b 100755
--- a/inference.py
+++ b/inference.py
@@ -14,7 +14,7 @@ from transformers import AutoProcessor, Gemma3ForConditionalGeneration
def clean_str(s):
- return s.removeprefix("```json").removesuffix("```").replace("\n", "").strip()
+ return s.removeprefix("```json").removesuffix("```").replace("\n", "").strip()
def captioning_prompt(image):
@@ -118,7 +118,7 @@ def main():
sys.stderr.write(f"Error loading JSON from string '{decoded}' for {filename=}\n")
data.update(new_data)
- print(json.dumps(data))
+ print(json.dumps(data))
elif args.mode == "from_scratch": # Generate caption & translation from scratch
for x in dataset: