Spaces:
Build error
Build error
Create backup.app.py
Browse files- backup.app.py +31 -0
backup.app.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 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.
|
2 |
+
# modify the example not to use filename
|
3 |
+
|
4 |
+
# Import required libraries
|
5 |
+
import streamlit as st
|
6 |
+
import graphviz as gv
|
7 |
+
|
8 |
+
# Function to create the Graphviz graph
|
9 |
+
def create_graph():
|
10 |
+
g = gv.Digraph('G', engine='dot', format='png')
|
11 |
+
|
12 |
+
# Create the first box
|
13 |
+
box1_label = 'Source Sequence: Question{s1,s2,s3}\nContext: {sx,sy,sz}\nAnswer: {s1,s2,s3}'
|
14 |
+
g.node('box1', label=box1_label, shape='box', style='rounded')
|
15 |
+
|
16 |
+
# Create the second box
|
17 |
+
box2_label = 'Target Sequence: The answer to the question given the context is yes.'
|
18 |
+
g.node('box2', label=box2_label, shape='box', style='rounded')
|
19 |
+
|
20 |
+
# Add the line connecting the two boxes
|
21 |
+
g.edge('box1', 'box2')
|
22 |
+
|
23 |
+
return g
|
24 |
+
|
25 |
+
# Create the graph
|
26 |
+
graph = create_graph()
|
27 |
+
|
28 |
+
# Streamlit app
|
29 |
+
st.title("In Context Learning - Prompt Targeting QA Pattern")
|
30 |
+
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.")
|
31 |
+
st.graphviz_chart(graph)
|