Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,37 @@
|
|
1 |
---
|
2 |
-
license:
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: llama2
|
3 |
---
|
4 |
+
|
5 |
+
* indo-instruct-llama2-32kmodel card
|
6 |
+
* Model Details
|
7 |
+
* Developed by: monuminu
|
8 |
+
* Backbone Model: LLaMA-2
|
9 |
+
* Language(s): English
|
10 |
+
* Library: HuggingFace Transformers
|
11 |
+
* License: Fine-tuned checkpoints is licensed under the Non-Commercial Creative Commons license (CC BY-NC-4.0)
|
12 |
+
* Where to send comments: Instructions on how to provide feedback or comments on a model can be found by opening an issue in the Hugging Face community's model repository
|
13 |
+
* Contact: For questions and comments about the model
|
14 |
+
* Dataset Details
|
15 |
+
* Used Datasets
|
16 |
+
* alpaca dataset
|
17 |
+
|
18 |
+
```
|
19 |
+
import torch
|
20 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
|
21 |
+
|
22 |
+
tokenizer = AutoTokenizer.from_pretrained("monuminu/indo-instruct-llama2-13b")
|
23 |
+
model = AutoModelForCausalLM.from_pretrained(
|
24 |
+
"monuminu/indo-instruct-llama2-32k",
|
25 |
+
device_map="auto",
|
26 |
+
torch_dtype=torch.float16,
|
27 |
+
load_in_8bit=True,
|
28 |
+
)
|
29 |
+
|
30 |
+
prompt = "### User:\nThomas is healthy, but he has to go to the hospital. What could be the reasons?\n\n### Assistant:\n"
|
31 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
32 |
+
del inputs["token_type_ids"]
|
33 |
+
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
34 |
+
|
35 |
+
output = model.generate(**inputs, streamer=streamer, use_cache=True, max_new_tokens=float('inf'))
|
36 |
+
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
37 |
+
```
|