Dark-O-Ether commited on
Commit
a7c09cd
·
1 Parent(s): d514e34

testing v-0.0.3

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py CHANGED
@@ -1,8 +1,27 @@
1
  import subprocess
2
  import json
3
  import streamlit as st
 
 
4
  # import time
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  prompt_format = \
7
  '''Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
8
 
 
1
  import subprocess
2
  import json
3
  import streamlit as st
4
+ import os
5
+ import stat
6
  # import time
7
 
8
+ # Get current permissions and add the execute bit for the owner
9
+ current_permissions = os.stat("init.sh").st_mode
10
+ os.chmod("init.sh", current_permissions | stat.S_IXUSR)
11
+
12
+ # Execute the init.sh script
13
+ try:
14
+ result = subprocess.run(["bash", "init.sh"], check=True, capture_output=True, text=True)
15
+ print("Script output:")
16
+ print(result.stdout)
17
+ st.write("Script output:")
18
+ st.write(result.stdout)
19
+ except subprocess.CalledProcessError as e:
20
+ print("An error occurred:")
21
+ print(e.stderr)
22
+ st.write("An error occurred:")
23
+ st.write(e.stderr)
24
+
25
  prompt_format = \
26
  '''Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
27