LearnableAI / app.py
ishworrsubedii's picture
update: prompt and response refinement
e289f8d
raw
history blame
1.09 kB
import streamlit as st
from src.pipeline.main import LearnableAI
def main():
st.title("LearnableAI Interface(Use Case 1)")
learnable_ai = LearnableAI()
words = st.text_input("Enter your words:", "")
interest = st.text_input("Enter your interest:", "")
difficulty = st.selectbox(
"Select difficulty level:",
("Beginner", "Easy", "Challenging", "Expert",
"Starter", "Basic", "Tough", "Master")
)
if st.button("Process with LearnableAI"):
if words and interest: # Only show warning if fields are empty
try:
result = learnable_ai.word_to_sentence(
words=list(words.split(",")),
interest=interest,
difficulties=difficulty
)
st.write("### Results")
st.write(result)
except Exception as e:
st.error(f"An error occurred: {str(e)}")
else:
st.warning("Please fill in both words and interest fields!")
if __name__ == "__main__":
main()