Update README.md
Browse files
README.md
CHANGED
@@ -99,7 +99,7 @@ We recommend using the model to respond to human instructions written in natural
|
|
99 |
Since this decoder-only model is fine-tuned with wrapper text, we suggest using the same wrapper text to achieve the best performance.
|
100 |
See the example on the right or the code below.
|
101 |
|
102 |
-
We now show you how to load and use our model using HuggingFace `
|
103 |
|
104 |
```python
|
105 |
# pip install -q transformers
|
@@ -107,15 +107,15 @@ from transformers import pipeline
|
|
107 |
|
108 |
checkpoint = "{model_name}"
|
109 |
|
110 |
-
model = pipeline('text-generation', model=checkpoint
|
111 |
|
112 |
instruction = 'Please let me know your thoughts on the given place and why you think it deserves to be visited: \n"Barcelona, Spain"'
|
113 |
|
114 |
input_prompt = f"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Response:"
|
115 |
|
116 |
-
generated_text =
|
117 |
|
118 |
-
print("Response"
|
119 |
```
|
120 |
|
121 |
## Training Procedure
|
|
|
99 |
Since this decoder-only model is fine-tuned with wrapper text, we suggest using the same wrapper text to achieve the best performance.
|
100 |
See the example on the right or the code below.
|
101 |
|
102 |
+
We now show you how to load and use our model using HuggingFace `pipeline()`.
|
103 |
|
104 |
```python
|
105 |
# pip install -q transformers
|
|
|
107 |
|
108 |
checkpoint = "{model_name}"
|
109 |
|
110 |
+
model = pipeline('text-generation', model = checkpoint)
|
111 |
|
112 |
instruction = 'Please let me know your thoughts on the given place and why you think it deserves to be visited: \n"Barcelona, Spain"'
|
113 |
|
114 |
input_prompt = f"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Response:"
|
115 |
|
116 |
+
generated_text = model(input_prompt, max_length=512, do_sample=True)[0]['generated_text']
|
117 |
|
118 |
+
print("Response", generated_text)
|
119 |
```
|
120 |
|
121 |
## Training Procedure
|