Spaces:
Sleeping
Sleeping
Download demo/examples.py from FlorianVal/DSSD-dev: direct link, hf CLI and curl.
- Browser
- Download file 1.96 kB
-
https://huggingface.co/spaces/FlorianVal/DSSD-dev/resolve/main/demo/examples.py
- Command line
-
hf download hf://spaces/FlorianVal/DSSD-dev/demo/examples.py
-
curl -L -o examples.py https://huggingface.co/spaces/FlorianVal/DSSD-dev/resolve/main/demo/examples.py
1.96 kB
| """Example prompts per domain. The models are base (pre-trained) models: prompts are plain-text | |
| completions in the format the heads were calibrated on (web text, GSM8K-style few-shot, Python).""" | |
| WEB = [ | |
| "The history of the bicycle begins in the early nineteenth century. In 1817, the German inventor Karl Drais " | |
| "built a two-wheeled \"running machine\" that riders pushed along with their feet. Over the following decades,", | |
| "Photosynthesis is the process by which plants, algae and some bacteria convert light energy into chemical " | |
| "energy. During photosynthesis, light energy is captured by chlorophyll and used to convert water and carbon " | |
| "dioxide into", | |
| ] | |
| _SHOTS = ( | |
| "Question: A baker makes 24 muffins in the morning and 18 in the afternoon. She sells 30 of them. " | |
| "How many muffins are left?\n" | |
| "Answer: She makes 24 + 18 = 42 muffins. After selling 30, she has 42 - 30 = 12 muffins left.\n#### 12\n\n" | |
| "Question: Tom reads 15 pages a day. How many pages does he read in 2 weeks?\n" | |
| "Answer: Two weeks have 2 * 7 = 14 days. He reads 15 * 14 = 210 pages.\n#### 210\n\n" | |
| ) | |
| MATH = [ | |
| _SHOTS + "Question: A train travels at 60 miles per hour for 3 hours, then at 40 miles per hour for 2 hours. " | |
| "How many miles does it travel in total?\nAnswer:", | |
| _SHOTS + "Question: Lisa has 3 boxes with 12 pencils each. She gives 9 pencils to her brother and buys 5 more. " | |
| "How many pencils does she have now?\nAnswer:", | |
| ] | |
| CODE = [ | |
| 'def count_vowels(text: str) -> int:\n """Return the number of vowels (a, e, i, o, u, case-insensitive) in text.\n\n' | |
| ' >>> count_vowels("Hello World")\n 3\n """\n', | |
| 'def merge_sorted(a: list[int], b: list[int]) -> list[int]:\n """Merge two sorted lists into one sorted ' | |
| 'list.\n\n >>> merge_sorted([1, 4, 9], [2, 3, 10])\n [1, 2, 3, 4, 9, 10]\n """\n', | |
| ] | |
| EXAMPLES = {"web": WEB, "gsm8k": MATH, "code": CODE} | |