Spaces:
Running
Running
matthoffner
commited on
Commit
ยท
44cc67b
1
Parent(s):
86d1042
Update main.py
Browse files
main.py
CHANGED
@@ -38,34 +38,46 @@ async def demo():
|
|
38 |
html_content = """
|
39 |
<!DOCTYPE html>
|
40 |
<html>
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
</html>
|
70 |
"""
|
71 |
return HTMLResponse(content=html_content, status_code=200)
|
|
|
38 |
html_content = """
|
39 |
<!DOCTYPE html>
|
40 |
<html>
|
41 |
+
<head>
|
42 |
+
<style>
|
43 |
+
body {
|
44 |
+
align-items: center;
|
45 |
+
background-color: #d9b99b;
|
46 |
+
display: flex;
|
47 |
+
height: 100vh;
|
48 |
+
justify-content: center;
|
49 |
+
}
|
50 |
+
|
51 |
+
#logs {
|
52 |
+
align-items: center;
|
53 |
+
background-color: #fff0db;
|
54 |
+
box-shadow:
|
55 |
+
12px 12px 16px 0 rgba(0, 0, 0, 0.25),
|
56 |
+
-8px -8px 12px 0 rgba(255, 255, 255, 0.3);
|
57 |
+
border-radius: 50px;
|
58 |
+
display: flex;
|
59 |
+
height: 200px;
|
60 |
+
justify-content: center;
|
61 |
+
margin-right: 4rem;
|
62 |
+
height:90vh;
|
63 |
+
}
|
64 |
+
</style>
|
65 |
+
</head>
|
66 |
|
67 |
+
<body>
|
68 |
+
|
69 |
+
<h1>StoryWriter Demo</h1>
|
70 |
+
<div id="content">
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<script>
|
74 |
+
var source = new EventSource("https://matthoffner-storywriter.hf.space/stream");
|
75 |
+
source.onmessage = function(event) {
|
76 |
+
document.getElementById("content").innerHTML += event.data
|
77 |
+
};
|
78 |
+
</script>
|
79 |
+
|
80 |
+
</body>
|
81 |
</html>
|
82 |
"""
|
83 |
return HTMLResponse(content=html_content, status_code=200)
|