Gemini commited on
Commit
e09e6c3
·
1 Parent(s): 8787dc9

fix: Resolve runtime errors and timeout issues\n\n- Create writable directories for logs and Hugging Face cache.\n- Set TRANSFORMERS_CACHE environment variable.\n- Fix SyntaxWarning in lpm_kernel/utils.py.\n- Disable ChromaDB telemetry to prevent posthog errors.

Browse files
Files changed (3) hide show
  1. lpm_kernel/utils.py +1 -1
  2. scripts/setup.sh +4 -0
  3. start.sh +4 -2
lpm_kernel/utils.py CHANGED
@@ -165,7 +165,7 @@ class TokenTextSplitter(TextSplitter):
165
 
166
  def _cut_meaningless_head_tail(self, text: str) -> str:
167
  # Only split when there are multiple newlines, as parsing of PDF/Word often contains false newlines
168
- sentences = re.split("\. |! |\? |。|!|?|\n+ *\n+", text)
169
  if len(sentences) < 2:
170
  return text
171
  head = sentences[0]
 
165
 
166
  def _cut_meaningless_head_tail(self, text: str) -> str:
167
  # Only split when there are multiple newlines, as parsing of PDF/Word often contains false newlines
168
+ sentences = re.split(r"\. |! |\? |。|!|?|\n+ *\n+", text)
169
  if len(sentences) < 2:
170
  return text
171
  head = sentences[0]
scripts/setup.sh CHANGED
@@ -607,6 +607,10 @@ parse_args() {
607
 
608
  # Main function
609
  main() {
 
 
 
 
610
  # Display welcome message
611
  display_header "Second-Me Complete Installation"
612
 
 
607
 
608
  # Main function
609
  main() {
610
+ # Create necessary directories with write permissions
611
+ mkdir -p "./logs"
612
+ mkdir -p "./.cache/huggingface/hub"
613
+
614
  # Display welcome message
615
  display_header "Second-Me Complete Installation"
616
 
start.sh CHANGED
@@ -22,5 +22,7 @@ else
22
  fi
23
 
24
  echo "--- Starting application... ---"
25
- cd /app
26
- python -m flask run --host=0.0.0.0 --port=${LOCAL_APP_PORT:-8002}
 
 
 
22
  fi
23
 
24
  echo "--- Starting application... ---"
25
+ export TRANSFORMERS_CACHE="/app/.cache/huggingface/hub"
26
+ export CHROMA_SERVER_NO_ANALYTICS=True
27
+ source "$SCRIPT_DIR/scripts/setup.sh"
28
+ python3 app.py