Update README.md
Browse files
README.md
CHANGED
|
@@ -37,17 +37,21 @@ This model has been fine-tuned on [Egrigor/ValheimTestData](https://huggingface.
|
|
| 37 |
|
| 38 |
To load and interact with the model, use the following code:
|
| 39 |
|
| 40 |
-
python
|
| 41 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 42 |
|
|
|
|
| 43 |
model = AutoModelForCausalLM.from_pretrained("Egrigor/ValheimAssistantV1")
|
| 44 |
tokenizer = AutoTokenizer.from_pretrained("Egrigor/ValheimAssistantV1")
|
| 45 |
|
|
|
|
| 46 |
inputs = tokenizer("How do I build a crafting station?", return_tensors="pt")
|
| 47 |
outputs = model.generate(**inputs, max_length=100)
|
|
|
|
|
|
|
| 48 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 49 |
|
| 50 |
|
|
|
|
| 51 |
## Training Details
|
| 52 |
|
| 53 |
|
|
|
|
| 37 |
|
| 38 |
To load and interact with the model, use the following code:
|
| 39 |
|
|
|
|
| 40 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 41 |
|
| 42 |
+
# Load the model and tokenizer
|
| 43 |
model = AutoModelForCausalLM.from_pretrained("Egrigor/ValheimAssistantV1")
|
| 44 |
tokenizer = AutoTokenizer.from_pretrained("Egrigor/ValheimAssistantV1")
|
| 45 |
|
| 46 |
+
# Prepare input and generate output
|
| 47 |
inputs = tokenizer("How do I build a crafting station?", return_tensors="pt")
|
| 48 |
outputs = model.generate(**inputs, max_length=100)
|
| 49 |
+
|
| 50 |
+
# Decode and print the output
|
| 51 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 52 |
|
| 53 |
|
| 54 |
+
|
| 55 |
## Training Details
|
| 56 |
|
| 57 |
|