Views
No views yet
python -m pip install setfit1from setfit import SetFitModel
2
3# Download from Hub and run inference
4model = SetFitModel.from_pretrained("krumeto/setfit-recipe-classifer")
5complicated_recipe = """Ingredients:
64 ounces pancetta, diced into 1/4 inch cubes
72 1/2 to 3 pounds veal shanks (4 to 6 pieces 2 to 3 inches thick)
81/2 cup diced onion
91/2 cup diced celery
101/2 cup diced carrot
113 garlic cloves , minced
121 1/2 cups canned chopped tomatoes
131 1/2 cups chicken broth
141/2 cup dry white wine
151 bay leaf
161 sprig fresh thyme
17salt
18freshly ground black pepper
19all-purpose flour for dredging
202 tablespoons unsalted butter
212 tablespoons extra-virgin olive oil
224 3-inch strips of lemon zest
23
24Directions:
25
26Preheat oven to 375°F.
27Heat the olive oil over medium heat in a large Dutch oven.
28Cook pancetta until browned and crisp.
29Remove pancetta with a slotted spoon and transfer to a paper towel-lined plate.
30Season veal shanks with salt and pepper and dredge in flour.
31Cook the veal until browned on all sides, working in batches if necessary, then transfer to a plate.
32Add the onion, celery, carrot, garlic, and a pinch of salt to the Dutch oven and cook until softened.
33Stir in the tomatoes, chicken broth, dry white wine, bay leaf, and thyme sprig.
34Return the veal shanks and pancetta to the Dutch oven and bring the liquid to a simmer.
35Cover the pot and place it in the oven to braise for 2-2 1/2 hours, until the veal is very tender.
36Serve with gremolata and garnish with lemon zest strips.
37Note: To make gremolata, finely chop 2 tablespoons fresh parsley, 1 tablespoon grated lemon zest, and 1 garlic clove. Mix together and sprinkle over the osso buco before serving."""
38
39# Run inference
40preds = model([complicated_recipe])1@article{https://doi.org/10.48550/arxiv.2209.11055,
2doi = {10.48550/ARXIV.2209.11055},
3url = {https://arxiv.org/abs/2209.11055},
4author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
5keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
6title = {Efficient Few-Shot Learning Without Prompts},
7publisher = {arXiv},
8year = {2022},
9copyright = {Creative Commons Attribution 4.0 International}
10}