Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import tempfile
|
|
5 |
import ollama
|
6 |
import streamlit as st
|
7 |
import chromadb
|
8 |
-
from langchain_text_splitters import
|
9 |
|
10 |
# Constants and global variables
|
11 |
GITHUB_OWNER = "sys-bio"
|
@@ -103,21 +103,13 @@ def convert_sbml_to_antimony(sbml_file_path, antimony_file_path):
|
|
103 |
print(f"Error converting SBML to Antimony: {e}")
|
104 |
|
105 |
def split_biomodels(antimony_file_path):
|
106 |
-
import subprocess
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
subprocess.run(["python", "-m", "spacy", "download", "en_core_web_sm"])
|
115 |
-
nlp = spacy.load("en_core_web_sm")
|
116 |
-
return nlp
|
117 |
-
|
118 |
-
# Ensure the spaCy model is installed
|
119 |
-
nlp = ensure_spacy_model()
|
120 |
-
text_splitter = SpacyTextSplitter(chunk_size=1000)
|
121 |
|
122 |
final_items = []
|
123 |
directory_path = os.path.dirname(os.path.abspath(antimony_file_path))
|
|
|
5 |
import ollama
|
6 |
import streamlit as st
|
7 |
import chromadb
|
8 |
+
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
9 |
|
10 |
# Constants and global variables
|
11 |
GITHUB_OWNER = "sys-bio"
|
|
|
103 |
print(f"Error converting SBML to Antimony: {e}")
|
104 |
|
105 |
def split_biomodels(antimony_file_path):
|
|
|
106 |
|
107 |
+
text_splitter = RecursiveCharacterTextSplitter(
|
108 |
+
chunk_size=1000,
|
109 |
+
chunk_overlap=20,
|
110 |
+
length_function=len,
|
111 |
+
is_separator_regex=False,
|
112 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
final_items = []
|
115 |
directory_path = os.path.dirname(os.path.abspath(antimony_file_path))
|