Spaces:
Running
on
Zero
Running
on
Zero
adds examples
Browse files
app.py
CHANGED
|
@@ -93,7 +93,23 @@ examples = [
|
|
| 93 |
[unimath1, additional_info_prompt, 2500],
|
| 94 |
[unimath2, additional_info_prompt, 2500],
|
| 95 |
[unimath3, additional_info_prompt, 2500],
|
| 96 |
-
[unimath4, additional_info_prompt, 2500]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
]
|
| 98 |
|
| 99 |
model_name = "AI-MO/Kimina-Prover-Distill-8B"
|
|
@@ -176,9 +192,10 @@ def main():
|
|
| 176 |
with gr.Column:
|
| 177 |
gr.Markdown(description)
|
| 178 |
with gr.Column:
|
| 179 |
-
gr.Markdown(joinus)
|
| 180 |
with gr.Row():
|
| 181 |
with gr.Column():
|
|
|
|
| 182 |
user_input = gr.Textbox(label="Your message or formal statement", lines=4)
|
| 183 |
informal = gr.Textbox(value=additional_info_prompt, label="Optional informal prefix")
|
| 184 |
max_tokens = gr.Slider(minimum=150, maximum=4096, value=2500, label="Max Tokens")
|
|
@@ -189,8 +206,12 @@ def main():
|
|
| 189 |
json_out = gr.JSON(label="Full Output")
|
| 190 |
code_out = gr.Code(label="Extracted Lean4 Code", language="python")
|
| 191 |
state = gr.State([])
|
| 192 |
-
# On submit, call chat_handler
|
| 193 |
submit.click(chat_handler, [user_input, informal, max_tokens, state], [chat, json_out, code_out, state])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
gr.Markdown(citation)
|
| 195 |
demo.launch()
|
| 196 |
|
|
|
|
| 93 |
[unimath1, additional_info_prompt, 2500],
|
| 94 |
[unimath2, additional_info_prompt, 2500],
|
| 95 |
[unimath3, additional_info_prompt, 2500],
|
| 96 |
+
[unimath4, additional_info_prompt, 2500],
|
| 97 |
+
# New examples
|
| 98 |
+
[
|
| 99 |
+
'''import Mathlib\nimport Aesop\n\nset_option maxHeartbeats 0\n\nopen BigOperators Real Nat Topology Rat\n\n/-- Let $a_1, a_2,\cdots, a_n$ be real constants, $x$ a real variable, and $f(x)=\\cos(a_1+x)+\\frac{1}{2}\\cos(a_2+x)+\\frac{1}{4}\\cos(a_3+x)+\\cdots+\\frac{1}{2^{n-1}}\\cos(a_n+x).$ Given that $f(x_1)=f(x_2)=0,$ prove that $x_2-x_1=m\\pi$ for some integer $m.$-/\ntheorem imo_1969_p2 (m n : \\R) (k : \\N) (a : \\N \\rightarrow \\R) (y : \\R \\rightarrow \\R) (hβ : 0 < k)\n(hβ : \\forall x, y x = \\sum i in Finset.range k, Real.cos (a i + x) / 2 ^ i) (hβ : y m = 0)\n(hβ : y n = 0) : \\exists t : \\Z, m - n = t * Real.pi := by''',
|
| 100 |
+
"/-- Let $a_1, a_2,\\cdots, a_n$ be real constants, $x$ a real variable, and $f(x)=\\cos(a_1+x)+\\frac{1}{2}\\cos(a_2+x)+\\frac{1}{4}\\cos(a_3+x)+\\cdots+\\frac{1}{2^{n-1}}\\cos(a_n+x).$ Given that $f(x_1)=f(x_2)=0,$ prove that $x_2-x_1=m\\pi$ for some integer $m.$-/",
|
| 101 |
+
2500
|
| 102 |
+
],
|
| 103 |
+
[
|
| 104 |
+
'''import Mathlib\nimport Aesop\n\nset_option maxHeartbeats 0\n\nopen BigOperators Real Nat Topology Rat\n\n/-- Suppose that $h(x)=f^{-1}(x)$. If $h(2)=10$, $h(10)=1$ and $h(1)=2$, what is $f(f(10))$? Show that it is 1.-/\ntheorem mathd_algebra_209 (Ο : Equiv \\R \\R) (hβ : Ο.2 2 = 10) (hβ : Ο.2 10 = 1) (hβ : Ο.2 1 = 2) :\nΟ.1 (Ο.1 10) = 1 := by''',
|
| 105 |
+
"/-- Suppose that $h(x)=f^{-1}(x)$. If $h(2)=10$, $h(10)=1$ and $h(1)=2$, what is $f(f(10))$? Show that it is 1.-/",
|
| 106 |
+
2500
|
| 107 |
+
],
|
| 108 |
+
[
|
| 109 |
+
'''import Mathlib\nimport Aesop\n\nset_option maxHeartbeats 0\n\nopen BigOperators Real Nat Topology Rat\n\n/-- At which point do the lines $s=9-2t$ and $t=3s+1$ intersect? Give your answer as an ordered pair in the form $(s, t).$ Show that it is (1,4).-//\ntheorem mathd_algebra_44 (s t : \\R) (hβ : s = 9 - 2 * t) (hβ : t = 3 * s + 1) : s = 1 \\wedge t = 4 := by''',
|
| 110 |
+
"/-- At which point do the lines $s=9-2t$ and $t=3s+1$ intersect? Give your answer as an ordered pair in the form $(s, t).$ Show that it is (1,4).-/",
|
| 111 |
+
2500
|
| 112 |
+
],
|
| 113 |
]
|
| 114 |
|
| 115 |
model_name = "AI-MO/Kimina-Prover-Distill-8B"
|
|
|
|
| 192 |
with gr.Column:
|
| 193 |
gr.Markdown(description)
|
| 194 |
with gr.Column:
|
| 195 |
+
gr.Markdown(joinus)
|
| 196 |
with gr.Row():
|
| 197 |
with gr.Column():
|
| 198 |
+
|
| 199 |
user_input = gr.Textbox(label="Your message or formal statement", lines=4)
|
| 200 |
informal = gr.Textbox(value=additional_info_prompt, label="Optional informal prefix")
|
| 201 |
max_tokens = gr.Slider(minimum=150, maximum=4096, value=2500, label="Max Tokens")
|
|
|
|
| 206 |
json_out = gr.JSON(label="Full Output")
|
| 207 |
code_out = gr.Code(label="Extracted Lean4 Code", language="python")
|
| 208 |
state = gr.State([])
|
|
|
|
| 209 |
submit.click(chat_handler, [user_input, informal, max_tokens, state], [chat, json_out, code_out, state])
|
| 210 |
+
gr.Examples(
|
| 211 |
+
examples=examples,
|
| 212 |
+
inputs=["user_input", "informal", "max_tokens"],
|
| 213 |
+
label="Example Problems"
|
| 214 |
+
)
|
| 215 |
gr.Markdown(citation)
|
| 216 |
demo.launch()
|
| 217 |
|