chrisyuan45
commited on
Commit
•
3a8f78e
1
Parent(s):
d4723e7
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc
|
3 |
+
pipeline_tag: text-generation
|
4 |
+
---
|
5 |
+
|
6 |
+
# TimeLlama
|
7 |
+
|
8 |
+
TimeLlama is an instruction-finetuned Llama2 series that improves complex temporal reasoning ability.
|
9 |
+
## Model Details
|
10 |
+
### Model Description
|
11 |
+
In this work, we introduce the first multi-source dataset for explainable temporal reasoning, called ExpTime. The dataset contains 26k examples derived from temporal knowledge graph datasets. Each example includes a context with multiple events, a future event to predict, and an explanation for the prediction in the form of temporal reasoning over the events.
|
12 |
+
|
13 |
+
To generate the dataset, we propose a novel knowledge-graph-instructed-generation strategy. The dataset supports the comprehensive evaluation of large language models on complex temporal reasoning, future event prediction, and explainability.
|
14 |
+
|
15 |
+
Based on ExpTime, we develop TimeLlaMA, a series of LLM models fine-tuned for explainable temporal reasoning. TimeLlaMA builds on the foundation LLM LLaMA-2 and utilizes instruction tuning to follow prompts for making explanations.
|
16 |
+
|
17 |
+
### Model Sources
|
18 |
+
|
19 |
+
- **Repository:** https://github.com/chenhan97/TimeLlama
|
20 |
+
- **Paper:** https://arxiv.org/abs/2310.01074
|
21 |
+
|
22 |
+
## Uses
|
23 |
+
|
24 |
+
### Direct Use
|
25 |
+
```python
|
26 |
+
from transformers import LlamaConfig, LlamaTokenizer, LlamaForCausalLM
|
27 |
+
# Model names: "chrisyuan45/TimeLlama-7b-chat", "chrisyuan45/TimeLlama-13b-chat"
|
28 |
+
model = LlamaForCausalLM.from_pretrained(
|
29 |
+
model_name,
|
30 |
+
return_dict=True,
|
31 |
+
load_in_8bit=quantization,
|
32 |
+
device_map="auto",
|
33 |
+
low_cpu_mem_usage=True)
|
34 |
+
tokenizer = LlamaTokenizer.from_pretrained(model_name)
|
35 |
+
```
|
36 |
+
|
37 |
+
### Finetune
|
38 |
+
Please check our repository for the detailed finetuning method.
|