sunbal7 commited on
Commit
bc20a41
Β·
verified Β·
1 Parent(s): a195e47

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import sympy as sp
3
+ from transformers import pipeline
4
+
5
+ # Load NLP Model
6
+ model = pipeline("text2text-generation", model="facebook/bart-large")
7
+
8
+ st.title("πŸ€– AI-Driven Mathematical Model Generator")
9
+ st.write("Enter a problem statement in natural language to get a mathematical model.")
10
+
11
+ user_input = st.text_area("✍️ Enter your problem:")
12
+
13
+ if st.button("πŸš€ Generate Model"):
14
+ response = model(user_input, max_length=200)
15
+ equation = sp.sympify(response[0]['generated_text'])
16
+
17
+ st.subheader("πŸ“Œ Mathematical Model:")
18
+ st.latex(sp.latex(equation))
19
+ st.code(str(equation), language='python')