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