Spaces:
Sleeping
Sleeping
File size: 930 Bytes
a314aa6 1a28741 441720b 430bd31 1a28741 af923f7 b2bcb97 441720b 1a28741 441720b 1a28741 441720b 1a28741 441720b 1a28741 |
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 28 |
import os
import streamlit as st
from transformers import pipeline
# Load the gated model
model_name = "internlm/internlm2-math-plus-7b"
token = os.environ.get("HF_TOKEN")
generator = pipeline('text-generation', model=model_name, token=token, trust_remote_code=True)
# 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]") |