awacke1 commited on
Commit
d3f3e34
·
1 Parent(s): a6f76bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -22
app.py CHANGED
@@ -29,16 +29,16 @@ st.set_page_config(
29
  st.title("Chat with AI")
30
 
31
  # Create a sidebar with menus
32
- st.sidebar.title("Menu")
33
- menu = ["Option 1", "Option 2", "Option 3"]
34
- choice = st.sidebar.selectbox("Choose an option", menu)
35
 
36
- if choice == "Option 1":
37
- st.sidebar.write("You selected Option 1")
38
- elif choice == "Option 2":
39
- st.sidebar.write("You selected Option 2")
40
- elif choice == "Option 3":
41
- st.sidebar.write("You selected Option 3")
42
 
43
  # Create a slider in the sidebar
44
  max_length = st.sidebar.slider(
@@ -53,17 +53,6 @@ def truncate_document(document, length):
53
  # my_document = 'your long string here'
54
  # truncated_document = truncate_document(my_document, max_length)
55
  # st.write(f"Truncated document: {truncated_document}")
56
-
57
- # Create two tabs
58
- tab = st.selectbox("Choose a tab", ["Tab 1", "Tab 2"])
59
-
60
- if tab == "Tab 1":
61
- st.header("Tab 1")
62
- st.write("This is some information for Tab 1")
63
-
64
- elif tab == "Tab 2":
65
- st.header("Tab 2")
66
- st.write("This is some information for Tab 2")
67
 
68
  def chat_with_model(prompts):
69
  model = "gpt-3.5-turbo"
@@ -117,8 +106,8 @@ def CompressXML(xml_text):
117
  if isinstance(elem.tag, str) and 'Comment' in elem.tag:
118
  elem.parent.remove(elem)
119
  #return ET.tostring(root, encoding='unicode', method="xml")
120
- return ET.tostring(root, encoding='unicode', method="xml")[:4000] # hack - top N characters to keep context document under token max
121
-
122
 
123
  def read_file_content(file):
124
  if file.type == "application/json":
 
29
  st.title("Chat with AI")
30
 
31
  # Create a sidebar with menus
32
+ # st.sidebar.title("Menu")
33
+ # menu = ["Option 1", "Option 2", "Option 3"]
34
+ # choice = st.sidebar.selectbox("Choose an option", menu)
35
 
36
+ # if choice == "Option 1":
37
+ # st.sidebar.write("You selected Option 1")
38
+ #elif choice == "Option 2":
39
+ # st.sidebar.write("You selected Option 2")
40
+ #elif choice == "Option 3":
41
+ # st.sidebar.write("You selected Option 3")
42
 
43
  # Create a slider in the sidebar
44
  max_length = st.sidebar.slider(
 
53
  # my_document = 'your long string here'
54
  # truncated_document = truncate_document(my_document, max_length)
55
  # st.write(f"Truncated document: {truncated_document}")
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  def chat_with_model(prompts):
58
  model = "gpt-3.5-turbo"
 
106
  if isinstance(elem.tag, str) and 'Comment' in elem.tag:
107
  elem.parent.remove(elem)
108
  #return ET.tostring(root, encoding='unicode', method="xml")
109
+ return ET.tostring(root, encoding='unicode', method="xml")[:max_length]
110
+
111
 
112
  def read_file_content(file):
113
  if file.type == "application/json":