Fix: Replace non-executable >>> prompt style with valid syntax in example code
Browse files## Description
The original example code contains REPL-style `>>>` prompts, which violate Hugging Face's standard for executable Model Card examples.
## Changes
All lines prefixed with `>>>` were replaced with syntactically valid Python code or comments.
For expected outputs, lines such as:
Replaced:
```python
>>> [{'summary_text': 'Liana Barrientos, 39, is charged with two counts of "offering a false instrument for filing in the first degree" In total, she has been married 10 times, with nine of her marriages occurring between 1999 and 2002. She is believed to still be married to four men.'}]
```
with:
```python
# >>> [{'summary_text': 'Liana Barrientos, 39, is charged with two counts of "offering a false instrument for filing in the first degree" In total, she has been married 10 times, with nine of her marriages occurring between 1999 and 2002. She is believed to still be married to four men.'}]
```
## Testing
The code has been successfully tested and runs without error.
## Note
This contribution is part of an ongoing research initiative to systematically identify and correct faulty example code in Hugging Face Model Cards.
We would appreciate a timely review and integration of this patch to support code reliability and enhance reproducibility for downstream users.
@@ -87,7 +87,7 @@ Her eighth husband, Rashid Rajput, was deported in 2006 to his native Pakistan a
|
|
87 |
If convicted, Barrientos faces up to four years in prison. Her next court appearance is scheduled for May 18.
|
88 |
"""
|
89 |
print(summarizer(ARTICLE, max_length=130, min_length=30, do_sample=False))
|
90 |
-
>>> [{'summary_text': 'Liana Barrientos, 39, is charged with two counts of "offering a false instrument for filing in the first degree" In total, she has been married 10 times, with nine of her marriages occurring between 1999 and 2002. She is believed to still be married to four men.'}]
|
91 |
```
|
92 |
|
93 |
### BibTeX entry and citation info
|
|
|
87 |
If convicted, Barrientos faces up to four years in prison. Her next court appearance is scheduled for May 18.
|
88 |
"""
|
89 |
print(summarizer(ARTICLE, max_length=130, min_length=30, do_sample=False))
|
90 |
+
# >>> [{'summary_text': 'Liana Barrientos, 39, is charged with two counts of "offering a false instrument for filing in the first degree" In total, she has been married 10 times, with nine of her marriages occurring between 1999 and 2002. She is believed to still be married to four men.'}]
|
91 |
```
|
92 |
|
93 |
### BibTeX entry and citation info
|