Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,15 +5,26 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
|
|
| 5 |
import torch
|
| 6 |
import json
|
| 7 |
|
| 8 |
-
LEAN4_DEFAULT_HEADER =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
title = """# 🙋🏻♂️Welcome to🌟Tonic's🔮Goedel Prover📉
|
| 11 |
You can build with this endpoint using🔮Goedel-Prover-SFT📉 available here : [Goedel-LM/Goedel-Prover-SFT](https://huggingface.co/Goedel-LM/Goedel-Prover-SFT)."""
|
| 12 |
|
| 13 |
def format_prompt(formal_statement, informal_prefix=""):
|
| 14 |
"""Format the input according to the Lean4 structure"""
|
| 15 |
-
return
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
def extract_code(response):
|
| 18 |
"""Extract code between lean4 code blocks and the model's output"""
|
| 19 |
try:
|
|
|
|
| 5 |
import torch
|
| 6 |
import json
|
| 7 |
|
| 8 |
+
LEAN4_DEFAULT_HEADER = (
|
| 9 |
+
"import Mathlib\n"
|
| 10 |
+
"import Aesop\n\n"
|
| 11 |
+
"set_option maxHeartbeats 0\n\n"
|
| 12 |
+
"open BigOperators Real Nat Topology Rat"
|
| 13 |
+
)
|
| 14 |
|
| 15 |
title = """# 🙋🏻♂️Welcome to🌟Tonic's🔮Goedel Prover📉
|
| 16 |
You can build with this endpoint using🔮Goedel-Prover-SFT📉 available here : [Goedel-LM/Goedel-Prover-SFT](https://huggingface.co/Goedel-LM/Goedel-Prover-SFT)."""
|
| 17 |
|
| 18 |
def format_prompt(formal_statement, informal_prefix=""):
|
| 19 |
"""Format the input according to the Lean4 structure"""
|
| 20 |
+
return (
|
| 21 |
+
f"Complete the following Lean 4 code with explanatory comments preceding each line of code:\n\n"
|
| 22 |
+
f"```lean4\n"
|
| 23 |
+
f"{LEAN4_DEFAULT_HEADER}\n"
|
| 24 |
+
f"{informal_prefix}\n"
|
| 25 |
+
f"{formal_statement}"
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
def extract_code(response):
|
| 29 |
"""Extract code between lean4 code blocks and the model's output"""
|
| 30 |
try:
|