Update README.md
Browse files
README.md
CHANGED
|
@@ -7,4 +7,28 @@ tags:
|
|
| 7 |
- code
|
| 8 |
- mathematics
|
| 9 |
- theorem-proving
|
| 10 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
- code
|
| 8 |
- mathematics
|
| 9 |
- theorem-proving
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
Usage
|
| 13 |
+
```python
|
| 14 |
+
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
| 15 |
+
from transformers import pipeline
|
| 16 |
+
model_name = "amitayusht/ProofWala-Multilingual"
|
| 17 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
| 18 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 19 |
+
pipeline = pipeline("text2text-generation", model=model, tokenizer=tokenizer)
|
| 20 |
+
# Example usage
|
| 21 |
+
state = """
|
| 22 |
+
Goals to prove:
|
| 23 |
+
[GOALS]
|
| 24 |
+
[GOAL] 1
|
| 25 |
+
forall n : nat, n + 1 = 1 + n
|
| 26 |
+
[END]
|
| 27 |
+
"""
|
| 28 |
+
result = pipeline(state, max_length=100, num_return_sequences=1)
|
| 29 |
+
print(result[0]['generated_text'])
|
| 30 |
+
# Output:
|
| 31 |
+
# [RUN TACTIC]
|
| 32 |
+
# induction n; trivial.
|
| 33 |
+
# [END]
|
| 34 |
+
```
|