mwitiderrick commited on
Commit
36843ed
·
1 Parent(s): 99280c4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -0
README.md CHANGED
@@ -53,3 +53,26 @@ Washa tanuri kamili hadi 350 ° F (175°C) na uweka sufuria ya kuoka katikati.
53
 
54
  """
55
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  """
55
  ```
56
+ ## Before Swahili Fine-tuning
57
+ ```python
58
+ from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
59
+
60
+ tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2")
61
+ model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2", device_map="auto")
62
+ query = "Nipe maagizo ya kutengeneza mkate wa mandizi"
63
+ text_gen = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=500)
64
+ output = text_gen(f"### Instruction:\n{query}\n### Response:\n")
65
+ print(output[0]['generated_text'])
66
+
67
+ """
68
+ To make a pancake, follow these steps:
69
+
70
+ 1. In a large bowl, mix together 1 1/2 cups of all-purpose flour, 3 1/2 teaspoons of baking powder, 1 teaspoon of salt, and 1 tablespoon of sugar.
71
+ 2. Make a well in the center of the flour mixture and pour in 1 1/2 cups of milk, 1 1/4 cups of buttermilk, 2 eggs, and 3 tablespoons of melted butter.
72
+ 3. Mix the ingredients together until they are just combined. Do not overmix.
73
+ 4. Let the batter rest for 30 minutes.
74
+ 5. Heat a griddle or large skillet over medium heat. Brush it with oil or melted butter.
75
+ 6. Using a 1/4 cup measure, scoop the batter onto the griddle or skillet. Cook until bubbles form on the surface and the edges start to look set, then flip and cook until the other side is golden brown.
76
+ 7. Serve the pancakes warm with your favorite toppings, such as maple syrup, whipped cream, or fresh fruit. Enjoy!
77
+ """
78
+ ```