CoTmodel / app.py
willco-afk's picture
Create app.py
2654826 verified
raw
history blame contribute delete
697 Bytes
import streamlit as st
from transformers import pipeline
# Load the CoT model (You can use a different model for CoT reasoning if needed)
cot_model = pipeline("text-generation", model="gpt-2")
# Title for the app
st.title("Chain-of-Thought (CoT) Reasoning")
# Input field for the question
question_input = st.text_area("Enter a question for Chain-of-Thought reasoning:")
# If the user has entered a question
if question_input:
# Generate the CoT output
response = cot_model(f"Let's think step by step: {question_input}", max_length=200, num_return_sequences=1)
# Display the result
st.write("Chain-of-Thought Reasoning Result:")
st.write(response[0]['generated_text'])