Spaces:
Running
Running
File size: 1,002 Bytes
1d710c4 a5ce2e8 2ab22e1 72ba764 a5ce2e8 1d710c4 2ab22e1 c073f18 a5ce2e8 1d710c4 a5ce2e8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import streamlit as st
from rag_engine import RAGEngine
import streamlit.components.v1 as components
st.title("🔮 Honkai Star Rail - Build Advisor (DeepSeek RAG)")
st.markdown("Ask me how to build any character, and I will tell you the **optimal setup**!")
# Initialize RAG
rag = RAGEngine()
# Embed Hugging Face interface using components
components.iframe("https://aika42-hsr-builds-llm.hf.space/?embed=true", height=600)
# User Input
query = st.text_input("Enter your build question (e.g., How to build Jingliu?)")
if query:
st.write("Generating answer...")
with st.spinner("Consulting the Stellaron Hunters..."):
stream = rag.stream_answer(query)
response = st.empty() # Create a container for streamed content
text = ""
# Stream and display each chunk as it comes in
for chunk in stream:
text += chunk # Add the chunk to the accumulated text
response.markdown(text) # Update the Streamlit app with the current text |