File size: 923 Bytes
a314aa6
441720b
a314aa6
441720b
 
 
 
6878a82
441720b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import streamlit as st
from huggingface_hub import login
from transformers import pipeline

# Load the gated model
model_name = "RickyDeSkywalker/TheoremLlama"
generator = pipeline('text-generation', model=model_name, token=os.environ.get("HF_TOKEN"))

# Streamlit app
st.title("Lean 4 Code Generation with TheoremLlama")
st.write("Enter a natural language prompt to generate Lean 4 code.")

# Text input for user prompt
prompt = st.text_area("Prompt", value="Prove that the sum of two even numbers is even.")

# Generate button
if st.button("Generate Lean 4 Code"):
    with st.spinner("Generating Lean 4 code..."):
        # Generate code based on the prompt
        result = generator(prompt, max_length=1000, num_return_sequences=1)
        generated_code = result[0]['generated_text']
    
    # Display the generated code
    st.code(generated_code, language='lean')

st.markdown("Developed by [Your Name]")