david-oplatka commited on
Commit
7d06222
·
1 Parent(s): cfd55e0

Delete Unnecessary Code

Browse files
Files changed (1) hide show
  1. utils.py +0 -22
utils.py CHANGED
@@ -1,7 +1,6 @@
1
  import os
2
  import requests
3
  import json
4
- # import re
5
 
6
  import streamlit as st
7
 
@@ -46,24 +45,3 @@ def send_amplitude_data(user_query, chat_response, demo_name, language, feedback
46
  response = requests.post('https://api2.amplitude.com/2/httpapi', headers=headers, data=json.dumps(data))
47
  if response.status_code != 200:
48
  print(f"Amplitude request failed with status code {response.status_code}. Response Text: {response.text}")
49
-
50
- # def escape_dollars_outside_latex(text):
51
- # # Define a regex pattern to find LaTeX equations (either single $ or double $$)
52
- # pattern = re.compile(r'(\$\$.*?\$\$|\$.*?\$)')
53
- # latex_matches = pattern.findall(text)
54
-
55
- # # Placeholder to temporarily store LaTeX equations
56
- # placeholders = {}
57
- # for i, match in enumerate(latex_matches):
58
- # placeholder = f'__LATEX_PLACEHOLDER_{i}__'
59
- # placeholders[placeholder] = match
60
- # text = text.replace(match, placeholder)
61
-
62
- # # Escape dollar signs in the rest of the text
63
- # text = text.replace('$', '\\$')
64
-
65
- # # Replace placeholders with the original LaTeX equations
66
- # for placeholder, original in placeholders.items():
67
- # text = text.replace(placeholder, original)
68
- # return text
69
-
 
1
  import os
2
  import requests
3
  import json
 
4
 
5
  import streamlit as st
6
 
 
45
  response = requests.post('https://api2.amplitude.com/2/httpapi', headers=headers, data=json.dumps(data))
46
  if response.status_code != 200:
47
  print(f"Amplitude request failed with status code {response.status_code}. Response Text: {response.text}")