new version code formula model

Signed-off-by: Matteo-Omenetti <Matteo.Omenetti1@ibm.com>
This commit is contained in:
Matteo-Omenetti 2025-03-10 11:32:59 +01:00
parent 4d64c4c0b6
commit ca94ff3410

View File

@ -124,7 +124,7 @@ class CodeFormulaModel(BaseItemAndImageEnrichmentModel):
repo_id="ds4sd/CodeFormula", repo_id="ds4sd/CodeFormula",
force_download=force, force_download=force,
local_dir=local_dir, local_dir=local_dir,
revision="v1.0.1", revision="v1.0.2",
) )
return Path(download_path) return Path(download_path)
@ -175,7 +175,7 @@ class CodeFormulaModel(BaseItemAndImageEnrichmentModel):
- The second element is the extracted language if a match is found; - The second element is the extracted language if a match is found;
otherwise, `None`. otherwise, `None`.
""" """
pattern = r"^<_([^>]+)_>\s*(.*)" pattern = r"^<_([^_>]+)_>\s(.*)"
match = re.match(pattern, input_string, flags=re.DOTALL) match = re.match(pattern, input_string, flags=re.DOTALL)
if match: if match:
language = str(match.group(1)) # the captured programming language language = str(match.group(1)) # the captured programming language