Instructions to use MightyDragon-Dev/language-dragon-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use MightyDragon-Dev/language-dragon-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("gpt2") model = PeftModel.from_pretrained(base_model, "MightyDragon-Dev/language-dragon-lora") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -48,5 +48,15 @@ model = PeftModel.from_pretrained(model, "MightyDragon-Dev/language-dragon-lora"
|
|
| 48 |
prompt = "歼-20 (Mighty Dragon) 在广东领空开启了加力燃烧室 (Afterburners)。由于 DSI 进气道的设计,它在超音速巡航时保持了极低的雷达散射截面 (RCS)。突然,预警机发出了警报"
|
| 49 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 50 |
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
|
|
|
| 48 |
prompt = "歼-20 (Mighty Dragon) 在广东领空开启了加力燃烧室 (Afterburners)。由于 DSI 进气道的设计,它在超音速巡航时保持了极低的雷达散射截面 (RCS)。突然,预警机发出了警报"
|
| 49 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 50 |
|
| 51 |
+
# 🐉 The 100-Token Endurance Challenge
|
| 52 |
+
outputs = model.generate(
|
| 53 |
+
**inputs,
|
| 54 |
+
max_new_tokens=100, # The 100-letter challenge!
|
| 55 |
+
do_sample=True, # Let the Dragon be creative
|
| 56 |
+
top_p=0.92, # High-precision filtering
|
| 57 |
+
temperature=0.7, # Balance between facts and flair
|
| 58 |
+
repetition_penalty=1.5, # Critical for small models
|
| 59 |
+
no_repeat_ngram_size=3 # Prevents "The jet, the jet, the jet..."
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|