Commit
·
7b17e5f
1
Parent(s):
9539210
testing v-0.0.6
Browse files
app.py
CHANGED
@@ -41,8 +41,11 @@ if env_var not in os.environ:
|
|
41 |
while not is_port_in_use(host, port):
|
42 |
print(f"Not listening on port: {host}:{port}")
|
43 |
print("Waiting 10 seconds before retrying...")
|
|
|
|
|
44 |
time.sleep(10)
|
45 |
print(f"Listening on port: {host}:{port}")
|
|
|
46 |
except subprocess.CalledProcessError as e:
|
47 |
print("An error occurred:")
|
48 |
print(e.stderr)
|
@@ -54,6 +57,7 @@ if env_var not in os.environ:
|
|
54 |
|
55 |
else:
|
56 |
print(f"{env_var} exists with value: {os.environ[env_var]}")
|
|
|
57 |
if is_port_in_use(host, port):
|
58 |
print(f"Something is listening on {host}:{port}")
|
59 |
print("No need to execute anything")
|
@@ -62,6 +66,8 @@ else:
|
|
62 |
else:
|
63 |
print(f"Nothing is listening on {host}:{port}")
|
64 |
print("Executing init2.sh")
|
|
|
|
|
65 |
try:
|
66 |
result = subprocess.run(["bash", "init2.sh"], check=True, capture_output=True, text=True)
|
67 |
print("Script output:")
|
|
|
41 |
while not is_port_in_use(host, port):
|
42 |
print(f"Not listening on port: {host}:{port}")
|
43 |
print("Waiting 10 seconds before retrying...")
|
44 |
+
# st.write(f"Not listening on port: {host}:{port}")
|
45 |
+
# st.write("Waiting 10 seconds before retrying...")
|
46 |
time.sleep(10)
|
47 |
print(f"Listening on port: {host}:{port}")
|
48 |
+
# st.write(f"Listening on port: {host}:{port}")
|
49 |
except subprocess.CalledProcessError as e:
|
50 |
print("An error occurred:")
|
51 |
print(e.stderr)
|
|
|
57 |
|
58 |
else:
|
59 |
print(f"{env_var} exists with value: {os.environ[env_var]}")
|
60 |
+
# st.write(f"{env_var} exists with value: {os.environ[env_var]}")
|
61 |
if is_port_in_use(host, port):
|
62 |
print(f"Something is listening on {host}:{port}")
|
63 |
print("No need to execute anything")
|
|
|
66 |
else:
|
67 |
print(f"Nothing is listening on {host}:{port}")
|
68 |
print("Executing init2.sh")
|
69 |
+
# st.write(f"Nothing is listening on {host}:{port}")
|
70 |
+
# st.write("Executing init2.sh")
|
71 |
try:
|
72 |
result = subprocess.run(["bash", "init2.sh"], check=True, capture_output=True, text=True)
|
73 |
print("Script output:")
|
init.sh
CHANGED
@@ -32,12 +32,12 @@ fi
|
|
32 |
# Launch llama-server in the background
|
33 |
echo "Starting llama-server in the background..."
|
34 |
cd build
|
35 |
-
./bin/llama-server \
|
36 |
-m ../llama.cpp/models/sarvam_entity_normalisation_llama_3.1_8b_unsloth.Q4_K_M.gguf \
|
37 |
-n 256 -c 1024 -t 2 -b 1 \
|
38 |
--temp 0.1 --repeat-penalty 1.1 --top-k 20 \
|
39 |
--port 8081 --mlock --numa numactl &
|
40 |
-
|
41 |
echo "llama-server launched. Waiting for the server to initialize..."
|
42 |
# (Optional) Wait a few seconds for the server to start before launching Streamlit
|
43 |
sleep 45
|
|
|
32 |
# Launch llama-server in the background
|
33 |
echo "Starting llama-server in the background..."
|
34 |
cd build
|
35 |
+
nohup ./bin/llama-server \
|
36 |
-m ../llama.cpp/models/sarvam_entity_normalisation_llama_3.1_8b_unsloth.Q4_K_M.gguf \
|
37 |
-n 256 -c 1024 -t 2 -b 1 \
|
38 |
--temp 0.1 --repeat-penalty 1.1 --top-k 20 \
|
39 |
--port 8081 --mlock --numa numactl &
|
40 |
+
disown
|
41 |
echo "llama-server launched. Waiting for the server to initialize..."
|
42 |
# (Optional) Wait a few seconds for the server to start before launching Streamlit
|
43 |
sleep 45
|
init2.sh
CHANGED
@@ -9,12 +9,12 @@ if [ -d "llama.cpp" ]; then
|
|
9 |
# Launch llama-server in the background
|
10 |
echo "Starting llama-server in the background..."
|
11 |
# cd build
|
12 |
-
./bin/llama-server \
|
13 |
-m ../llama.cpp/models/sarvam_entity_normalisation_llama_3.1_8b_unsloth.Q4_K_M.gguf \
|
14 |
-n 256 -c 1024 -t 2 -b 1 \
|
15 |
--temp 0.1 --repeat-penalty 1.1 --top-k 20 \
|
16 |
--port 8081 --mlock --numa numactl &
|
17 |
-
|
18 |
echo "llama-server launched. Waiting for the server to initialize..."
|
19 |
# (Optional) Wait a few seconds for the server to start before launching Streamlit
|
20 |
sleep 45
|
@@ -33,12 +33,12 @@ elif [ "$(basename "$PWD")" = "llama.cpp" ]; then
|
|
33 |
# Launch llama-server in the background
|
34 |
echo "Starting llama-server in the background..."
|
35 |
# cd build
|
36 |
-
./bin/llama-server \
|
37 |
-m ../llama.cpp/models/sarvam_entity_normalisation_llama_3.1_8b_unsloth.Q4_K_M.gguf \
|
38 |
-n 256 -c 1024 -t 2 -b 1 \
|
39 |
--temp 0.1 --repeat-penalty 1.1 --top-k 20 \
|
40 |
--port 8081 --mlock --numa numactl &
|
41 |
-
|
42 |
echo "llama-server launched. Waiting for the server to initialize..."
|
43 |
# (Optional) Wait a few seconds for the server to start before launching Streamlit
|
44 |
sleep 45
|
|
|
9 |
# Launch llama-server in the background
|
10 |
echo "Starting llama-server in the background..."
|
11 |
# cd build
|
12 |
+
nohup ./bin/llama-server \
|
13 |
-m ../llama.cpp/models/sarvam_entity_normalisation_llama_3.1_8b_unsloth.Q4_K_M.gguf \
|
14 |
-n 256 -c 1024 -t 2 -b 1 \
|
15 |
--temp 0.1 --repeat-penalty 1.1 --top-k 20 \
|
16 |
--port 8081 --mlock --numa numactl &
|
17 |
+
disown
|
18 |
echo "llama-server launched. Waiting for the server to initialize..."
|
19 |
# (Optional) Wait a few seconds for the server to start before launching Streamlit
|
20 |
sleep 45
|
|
|
33 |
# Launch llama-server in the background
|
34 |
echo "Starting llama-server in the background..."
|
35 |
# cd build
|
36 |
+
nohup ./bin/llama-server \
|
37 |
-m ../llama.cpp/models/sarvam_entity_normalisation_llama_3.1_8b_unsloth.Q4_K_M.gguf \
|
38 |
-n 256 -c 1024 -t 2 -b 1 \
|
39 |
--temp 0.1 --repeat-penalty 1.1 --top-k 20 \
|
40 |
--port 8081 --mlock --numa numactl &
|
41 |
+
disown
|
42 |
echo "llama-server launched. Waiting for the server to initialize..."
|
43 |
# (Optional) Wait a few seconds for the server to start before launching Streamlit
|
44 |
sleep 45
|