Update README.md
Browse files
README.md
CHANGED
@@ -25,6 +25,29 @@ Made possible thanks to [a detailed notebook from Unsloth](https://colab.researc
|
|
25 |
- "**wikimedia/wikipedia**:" (20231101.ja) for continued pretaining
|
26 |
- "**FreedomIntelligence/alpaca-gpt4-japanese**" for instruction fine tuning
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
# Uploaded model
|
29 |
|
30 |
- **Developed by:** Ryu-m0m
|
|
|
25 |
- "**wikimedia/wikipedia**:" (20231101.ja) for continued pretaining
|
26 |
- "**FreedomIntelligence/alpaca-gpt4-japanese**" for instruction fine tuning
|
27 |
|
28 |
+
# Inference Template:
|
29 |
+
|
30 |
+
# Use a pipeline as a high-level helper
|
31 |
+
|
32 |
+
```
|
33 |
+
from transformers import pipeline
|
34 |
+
|
35 |
+
pipe = pipeline("text-generation", model="Ryu-m0m/16bit-japanese-finetuned-mistral-7b-v0")
|
36 |
+
|
37 |
+
instruction = "侍の歴史を簡単に教えてください。" # Can you give us a brief history of the Samurai?
|
38 |
+
response = pipe(
|
39 |
+
instruction,
|
40 |
+
max_length=150, # Controls the length of the output
|
41 |
+
temperature=0.7, # Controls randomness; lower is more deterministic
|
42 |
+
top_k=50, # Limits sampling pool to top 50 tokens
|
43 |
+
top_p=0.9, # Nucleus sampling, considering tokens up to 90% cumulative probability
|
44 |
+
num_return_sequences=1 # Generates only one response
|
45 |
+
)
|
46 |
+
|
47 |
+
print(response[0]['generated_text'])
|
48 |
+
|
49 |
+
```
|
50 |
+
|
51 |
# Uploaded model
|
52 |
|
53 |
- **Developed by:** Ryu-m0m
|