awacke1 commited on
Commit
0fe244f
·
1 Parent(s): 4e3d3a7

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +76 -0
app.py ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ This streamlit demonstration is meant to simulate two types of memory within cognitive architecture:
2
+ # Each time we remember a moment, we construct it anew.
3
+ # We use the building blocks of Episodic Memory which is recall of feelings of being somewhere.
4
+ # We also use Semantic Memory which is concrete knowledge about our world and about our personal history.
5
+ # With Episodic Memory, its purpose is to provide us with coherence connecting events. In Episodic Memory, accuracy is less important than consistency.
6
+ # In order to have a strong sense of self, it is important that our memories fit with our beliefs and feelings about ourselves.
7
+
8
+ import time
9
+ import re
10
+ import pandas as pd
11
+ import numpy as np
12
+ import torch
13
+ import torch.nn.functional as F
14
+ import graphviz as graphviz
15
+ import pydeck as pdk
16
+ import streamlit as st
17
+
18
+ from transformers import AutoTokenizer, AutoModel
19
+ from tokenizers import Tokenizer, AddedToken
20
+ from st_click_detector import click_detector
21
+
22
+ # Define selection options and sort alphabetically
23
+
24
+ st.graphviz_chart('''
25
+
26
+ digraph G {bgcolor="#0000FF44:#FF000044" gradientangle=90
27
+ fontname="Helvetica,Arial,sans-serif"
28
+ node [fontname="Helvetica,Arial,sans-serif"]
29
+ edge [fontname="Helvetica,Arial,sans-serif"]
30
+
31
+ subgraph cluster_0 {
32
+ style=filled;
33
+ color=lightgrey;
34
+ fillcolor="darkgray:gold";
35
+ gradientangle=0
36
+ node [fillcolor="yellow:green" style=filled gradientangle=270] a0;
37
+ node [fillcolor="lightgreen:red"] a1;
38
+ node [fillcolor="lightskyblue:darkcyan"] a2;
39
+ node [fillcolor="cyan:lightslateblue"] a3;
40
+
41
+ a0 -> a1 -> a2 -> a3;
42
+ label = "process #1";
43
+ }
44
+
45
+ subgraph cluster_1 {
46
+ node [fillcolor="yellow:magenta"
47
+ style=filled gradientangle=270] b0;
48
+ node [fillcolor="violet:darkcyan"] b1;
49
+ node [fillcolor="peachpuff:red"] b2;
50
+ node [fillcolor="mediumpurple:purple"] b3;
51
+
52
+ b0 -> b1 -> b2 -> b3;
53
+ label = "process #2";
54
+ color=blue
55
+ fillcolor="darkgray:gold";
56
+ gradientangle=0
57
+ style=filled;
58
+ }
59
+ start -> a0;
60
+ start -> b0;
61
+ a1 -> b3;
62
+ b2 -> a3;
63
+ a3 -> a0;
64
+ a3 -> end;
65
+ b3 -> end;
66
+
67
+ start [shape=Mdiamond ,
68
+ fillcolor="pink:red",
69
+ gradientangle=90,
70
+ style=radial];
71
+ end [shape=Msquare,
72
+ fillcolor="lightyellow:orange",
73
+ style=radial,
74
+ gradientangle=90];
75
+ }
76
+ ''')