File size: 720 Bytes
ca0b264 ad41b4f ca0b264 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import streamlit as st
from transformers import pipeline
# Load the question-answering pipeline
qa_pipeline = pipeline("question-answering", model="nlpaueb/bert-base-greek-uncased-v1")
# Title of the app
st.title("Question Answering with Meltemi-7B")
# Input fields for context and question
context = st.text_area("Context", "Provide the context here...")
question = st.text_input("Question", "Ask your question here...")
# Generate answer when the user presses the button
if st.button("Get Answer"):
if context and question:
result = qa_pipeline(question=question, context=context)
st.write(f"Answer: {result['answer']}")
else:
st.write("Please provide both context and a question.") |