Spaces:
Build error
Build error
# Write a streamlit graphviz python program that creates a graph with two boxes and a line between them. The first box should have an outline with this information: Source Sequence: Question{s1,s2,s3}, Context: {sx,sy,sz}, and Answer: {s1,s2,s3}. The second box should have: Target Sequence: The answer to the question given the context is yes. | |
# modify the example not to use filename | |
# Import required libraries | |
import streamlit as st | |
import graphviz as gv | |
# Function to create the Graphviz graph | |
def create_graph(): | |
g = gv.Digraph('G', engine='dot', format='png') | |
# Create the first box | |
box1_label = 'Source Sequence: Question{s1,s2,s3}\nContext: {sx,sy,sz}\nAnswer: {s1,s2,s3}' | |
g.node('box1', label=box1_label, shape='box', style='rounded') | |
# Create the second box | |
box2_label = 'Target Sequence: The answer to the question given the context is yes.' | |
g.node('box2', label=box2_label, shape='box', style='rounded') | |
# Add the line connecting the two boxes | |
g.edge('box1', 'box2') | |
return g | |
# Create the graph | |
graph = create_graph() | |
# Streamlit app | |
st.title("In Context Learning - Prompt Targeting QA Pattern") | |
st.subheader("The Question / Answer pattern below can be used in concert with a LLM to do real time in context learning using general intelligence.") | |
st.graphviz_chart(graph) | |