Teja-Gollapudi
commited on
Commit
•
4e0dc3b
1
Parent(s):
af559ac
Update README.md
Browse files
README.md
CHANGED
@@ -41,6 +41,42 @@ output = model(prompt, max_length=256, do_sample=True)
|
|
41 |
|
42 |
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
'''
|
45 |
[{'generated_text': 'Recipe for making caramel flan: 2 cups all-purpose flour 3 cups butter 6 tablespoons sugar 2 tablespoons melted dark chocolate 2 cups milk Instructions: 1.
|
46 |
Preheat oven to 350°F (180°C). 2. Grease 9 inch round cake pan. 3. In a large bowl, whisk together flour, baking powder, cocoa powder, salt and salt.
|
|
|
41 |
|
42 |
|
43 |
|
44 |
+
'''
|
45 |
+
[{'generated_text': 'Recipe for making caramel flan: 2 cups all-purpose flour 3 cups butter 6 tablespoons sugar 2 tablespoons melted dark chocolate 2 cups milk Instructions: 1.
|
46 |
+
Preheat oven to 350°F (180°C). 2. Grease 9 inch round cake pan. 3. In a large bowl, whisk together flour, baking powder, cocoa powder, salt and salt.
|
47 |
+
4. Beat until fluffy. 5. Add the melted chocolate, vanilla and sugar and beat until blended. 6. Pour batter into the prepared pan and bake for 45 minutes.
|
48 |
+
7. Remove the pan from the oven and let cool before serving.'}]
|
49 |
+
|
50 |
+
|
51 |
+
'''
|
52 |
+
|
53 |
+
|
54 |
+
```
|
55 |
+
|
56 |
+
|
57 |
+
Using Alpaca prompt template might generate better outputs for certain prompts as the model was trained using the template.
|
58 |
+
|
59 |
+
```
|
60 |
+
from transformers import pipeline
|
61 |
+
model = pipeline(model="vmware/flan-t5-large-alpaca",device_map = 'auto')
|
62 |
+
|
63 |
+
|
64 |
+
prompt_template = """Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
65 |
+
|
66 |
+
### Instruction:
|
67 |
+
{prompt}
|
68 |
+
|
69 |
+
### Response:
|
70 |
+
"""
|
71 |
+
|
72 |
+
prompt = "Give me the recipe for making a caramel flan"
|
73 |
+
|
74 |
+
|
75 |
+
output = model(prompt_template.format(prompt), max_length=256, do_sample=True)
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
'''
|
81 |
[{'generated_text': 'Recipe for making caramel flan: 2 cups all-purpose flour 3 cups butter 6 tablespoons sugar 2 tablespoons melted dark chocolate 2 cups milk Instructions: 1.
|
82 |
Preheat oven to 350°F (180°C). 2. Grease 9 inch round cake pan. 3. In a large bowl, whisk together flour, baking powder, cocoa powder, salt and salt.
|