Skip to content

Commit 625ac50

Browse files
authored
🐛 fix Use this model snippets for PaddleOCR models (#1659)
The PaddleOCR requires model name only, without namespace
1 parent 2655638 commit 625ac50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ export const paddleocr = (model: ModelData): string[] => {
10381038
return [
10391039
`# pip install paddleocr
10401040
from paddleocr import DocVLM
1041-
model = DocVLM(model_name="${model.id}")
1041+
model = DocVLM(model_name="${nameWithoutNamespace(model.id)}")
10421042
output = model.predict(
10431043
input={"image": "path/to/image.png", "query": "Parsing this image and output the content in Markdown format."},
10441044
batch_size=1
@@ -1056,7 +1056,7 @@ for res in output:
10561056
return [
10571057
`# pip install paddleocr
10581058
from paddleocr import ${className}
1059-
model = ${className}(model_name="${model.id}")
1059+
model = ${className}(model_name="${nameWithoutNamespace(model.id)}")
10601060
output = model.predict(input="path/to/image.png", batch_size=1)
10611061
for res in output:
10621062
res.print()

0 commit comments

Comments
 (0)