Spaces:
Runtime error
Runtime error
File size: 622 Bytes
86f6634 b280ffb 86f6634 b280ffb 86f6634 b280ffb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import streamlit as st
import subprocess
import json
st.title('Math Problem Solver')
api_key = st.text_input("Enter your API Key:")
math_problem = st.text_input("Enter your math problem:")
if st.button('Solve'):
if api_key and math_problem:
input_data = {
"math_problem": math_problem,
"api_key": api_key
}
result = subprocess.check_output(
["python", "query_solver.py"],
input=json.dumps(input_data),
text=True
)
st.write(result.strip())
else:
st.write("Please provide both API key and math problem.") |