georad commited on
Commit
f464139
·
verified ·
1 Parent(s): 48a277b

Delete app_demo_header.py

Browse files
Files changed (1) hide show
  1. app_demo_header.py +0 -49
app_demo_header.py DELETED
@@ -1,49 +0,0 @@
1
- import streamlit as st
2
- import torch
3
- import uuid
4
- import nest_asyncio
5
- import asyncio
6
- import sys
7
-
8
- torch.classes.__path__ = []
9
-
10
- if 'device_id' not in st.session_state:
11
- st.session_state.device_id = str(uuid.uuid4())
12
-
13
- if "feedback_key" not in st.session_state:
14
- st.session_state.feedback_key = 0
15
-
16
-
17
- async def launch_bot():
18
- def reset():
19
- st.session_state.messages = [{"role": "assistant", "content": initial_prompt, "avatar": "🦖"}]
20
- st.session_state.log_messages = []
21
- st.session_state.prompt = None
22
- st.session_state.ex_prompt = None
23
- st.session_state.first_turn = True
24
- st.session_state.show_logs = False
25
- if 'agent' not in st.session_state:
26
- st.session_state.agent = initialize_agent(cfg, agent_progress_callback=agent_progress_callback)
27
- else:
28
- st.session_state.agent.clear_memory()
29
- if 'cfg' not in st.session_state:
30
- #cfg = st.session_state.cfg
31
- st.session_state.cfg = cfg
32
- st.session_state.ex_prompt = None
33
- example_messages = [example.strip() for example in cfg.examples.split(";")] if cfg.examples else []
34
- st.session_state.example_messages = [em for em in example_messages if len(em)>0]
35
- reset()
36
-
37
- cfg = st.session_state.cfg
38
- sys.stdout.flush()
39
-
40
- if "feedback_key" not in st.session_state:
41
- st.session_state.feedback_key = 0
42
-
43
- if __name__ == "__main__":
44
- st.set_page_config(page_title="Test Sticky Header", layout="wide")
45
- nest_asyncio.apply()
46
- asyncio.run(launch_bot())
47
- st.image("images/SBS_Chapter_Index.png")
48
- for i in range(50):
49
- st.write(f"Settings: Scrollable content line {i+1}")