Spaces:
Runtime error
Runtime error
import streamlit as st | |
from graphviz import Digraph | |
# Initialize Streamlit app | |
st.title("Process Flow Diagram") | |
# Initialize Graphviz object | |
dot = Digraph(format="png") | |
dot.attr(rankdir='LR', size='10') | |
# Add nodes and edges | |
dot.node("1", "File Uploader\nConverts Input Files to Text") | |
dot.node("2", "Extract 3 Text Chunks\nand Create an Embedding for Each") | |
dot.node("3", "Combine Embeddings into\nAI Semantic Index (FAISS)\nand Store as Knowledge Base (KB)") | |
dot.node("4", "Add Semantic Search with\nQuestion and Question Embeddings") | |
dot.node("5", "Put Query and Document\nEmbeddings onto Chat Memory\non a Language Chain then Run Inference") | |
dot.node("6", "Store Inference Output\nand Show to User") | |
dot.node("7", "Score Rouge LCS to Define\nLongest Continuous Match with\nOriginal Document") | |
dot.node("8", "Give User a Way to Upvote π\nor Downvote π\nand Name Files for Each Step") | |
# Define edges | |
dot.edges(["12", "23", "34", "45", "56", "67", "78"]) | |
# Generate and save the diagram | |
dot.render(filename="/tmp/process_flow", cleanup=True) | |
# Display using Streamlit | |
st.image("/tmp/process_flow.png") | |