Improve model card with pipeline tag and library name
#1
by
nielsr
HF Staff
- opened
README.md
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
---
|
2 |
-
license: mit
|
3 |
-
language:
|
4 |
-
- en
|
5 |
base_model:
|
6 |
- deepseek-ai/deepseek-coder-7b-instruct-v1.5
|
|
|
|
|
|
|
|
|
|
|
7 |
---
|
8 |
|
9 |
<p align="center">
|
@@ -12,19 +14,8 @@ base_model:
|
|
12 |
|
13 |
## Introduction
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
- **Requirement Analysis**: given requirements and description of the verification or modeling goals, decomposing the goal into detailed verification steps
|
18 |
|
19 |
-
- **Proof/Model Generation**: given requirements and description of the verification or modeling goals, writing formal proofs or models that can be verified by verifier/model checker.
|
20 |
-
|
21 |
-
- **Proof segment generation**
|
22 |
-
|
23 |
-
- **Proof Completion**: complete the given incomplete proofs or models
|
24 |
-
|
25 |
-
- **Proof Infilling**: filling in the middle of the given incomplete proofs or models
|
26 |
-
|
27 |
-
- **Code 2 Proof**: (Currently only support for ACSL whose specification is in form of code annotations) given the code under verification, generate the proof with the specifications
|
28 |
|
29 |
## Application Scenario
|
30 |
|
@@ -57,9 +48,9 @@ You only need to return the TLA formal specification without explanation.
|
|
57 |
|
58 |
input_text = """
|
59 |
An operation `LM_Inner_Rsp(p)` that represents a response process for a given parameter `p`. It satisfies the following conditions:
|
60 |
-
- The control state `octl[p]` is equal to
|
61 |
- The `Reply(p, obuf[p], memInt, memInt')` operation is executed.
|
62 |
-
- The control state `octl` is updated by setting the `p` index of `octl` to
|
63 |
- The variables `omem` and `obuf` remain unchanged.
|
64 |
"""
|
65 |
|
@@ -70,7 +61,8 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
70 |
)
|
71 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
72 |
|
73 |
-
messages = [{"role": "user", "content": f"{instruct}
|
|
|
74 |
|
75 |
text = tokenizer.apply_chat_template(
|
76 |
messages, tokenize=False, add_generation_prompt=True
|
@@ -101,9 +93,9 @@ You only need to return the TLA formal specification without explanation.
|
|
101 |
|
102 |
input_text = """
|
103 |
An operation `LM_Inner_Rsp(p)` that represents a response process for a given parameter `p`. It satisfies the following conditions:
|
104 |
-
- The control state `octl[p]` is equal to
|
105 |
- The `Reply(p, obuf[p], memInt, memInt')` operation is executed.
|
106 |
-
- The control state `octl` is updated by setting the `p` index of `octl` to
|
107 |
- The variables `omem` and `obuf` remain unchanged.
|
108 |
"""
|
109 |
|
@@ -123,7 +115,8 @@ llm = LLM(
|
|
123 |
)
|
124 |
|
125 |
# Prepare chat messages
|
126 |
-
chat_message = [{"role": "user", "content": f"{instruct}
|
|
|
127 |
|
128 |
# Inference
|
129 |
responses = llm.chat(chat_message, greed_sampling, use_tqdm=True)
|
@@ -142,5 +135,4 @@ print(responses[0].outputs[0].text)
|
|
142 |
primaryClass={cs.AI},
|
143 |
url={https://arxiv.org/abs/2501.16207},
|
144 |
}
|
145 |
-
|
146 |
-
```
|
|
|
1 |
---
|
|
|
|
|
|
|
2 |
base_model:
|
3 |
- deepseek-ai/deepseek-coder-7b-instruct-v1.5
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
license: mit
|
7 |
+
pipeline_tag: text-generation
|
8 |
+
library_name: transformers
|
9 |
---
|
10 |
|
11 |
<p align="center">
|
|
|
14 |
|
15 |
## Introduction
|
16 |
|
17 |
+
This model, presented in the paper [From Informal to Formal -- Incorporating and Evaluating LLMs on Natural Language Requirements to Verifiable Formal Proofs](https://hf.co/papers/2501.16207), is a fine-tuned LLM for formal verification tasks. Trained on 18k high-quality instruction-response pairs across five formal specification languages (Coq, Dafny, Lean4, ACSL, and TLA+), it excels at various sub-tasks including requirement analysis, proof/model generation, and code-to-proof translation (for ACSL). Interestingly, fine-tuning on this formal data also enhances the model's mathematics, reasoning, and coding capabilities.
|
|
|
|
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
## Application Scenario
|
21 |
|
|
|
48 |
|
49 |
input_text = """
|
50 |
An operation `LM_Inner_Rsp(p)` that represents a response process for a given parameter `p`. It satisfies the following conditions:
|
51 |
+
- The control state `octl[p]` is equal to `"done"`.
|
52 |
- The `Reply(p, obuf[p], memInt, memInt')` operation is executed.
|
53 |
+
- The control state `octl` is updated by setting the `p` index of `octl` to `"rdy"`.
|
54 |
- The variables `omem` and `obuf` remain unchanged.
|
55 |
"""
|
56 |
|
|
|
61 |
)
|
62 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
63 |
|
64 |
+
messages = [{"role": "user", "content": f"{instruct}
|
65 |
+
{input_text}"}]
|
66 |
|
67 |
text = tokenizer.apply_chat_template(
|
68 |
messages, tokenize=False, add_generation_prompt=True
|
|
|
93 |
|
94 |
input_text = """
|
95 |
An operation `LM_Inner_Rsp(p)` that represents a response process for a given parameter `p`. It satisfies the following conditions:
|
96 |
+
- The control state `octl[p]` is equal to `"done"`.
|
97 |
- The `Reply(p, obuf[p], memInt, memInt')` operation is executed.
|
98 |
+
- The control state `octl` is updated by setting the `p` index of `octl` to `"rdy"`.
|
99 |
- The variables `omem` and `obuf` remain unchanged.
|
100 |
"""
|
101 |
|
|
|
115 |
)
|
116 |
|
117 |
# Prepare chat messages
|
118 |
+
chat_message = [{"role": "user", "content": f"{instruct}
|
119 |
+
{input_text}"}]
|
120 |
|
121 |
# Inference
|
122 |
responses = llm.chat(chat_message, greed_sampling, use_tqdm=True)
|
|
|
135 |
primaryClass={cs.AI},
|
136 |
url={https://arxiv.org/abs/2501.16207},
|
137 |
}
|
138 |
+
```
|
|