Haseeb commited on
Commit
21356bd
β€’
1 Parent(s): 8d5b8ec
Files changed (2) hide show
  1. README.md +1 -1
  2. bardcode_interpreter.py +6 -2
README.md CHANGED
@@ -6,7 +6,7 @@ sdk_version: 1.21.0
6
  emoji: πŸš€
7
  app_file: bardcode_interpreter.py
8
  colorFrom: green
9
- colorTo: green
10
  pinned: true
11
  ---
12
 
 
6
  emoji: πŸš€
7
  app_file: bardcode_interpreter.py
8
  colorFrom: green
9
+ colorTo: blue
10
  pinned: true
11
  ---
12
 
bardcode_interpreter.py CHANGED
@@ -9,6 +9,7 @@ Dependencies : streamlit, bard-coder
9
  Author : HeavenHM.
10
  License : MIT
11
  Date : 21-05-2023
 
12
  """
13
 
14
  # Import the required libraries
@@ -393,8 +394,11 @@ def init_session_state():
393
 
394
  def make_code_interpreter_read_only(files=[],folders:str="lib"):
395
  for filename in files:
396
- BardCoder.write_log(f"Making {filename} read-only")
397
- os.chmod(filename, S_IREAD|S_IRGRP|S_IROTH)
 
 
 
398
 
399
  # Make all files in lib folder read-only
400
  BardCoder.write_log(f"Making all files in {folders} folder read-only")
 
9
  Author : HeavenHM.
10
  License : MIT
11
  Date : 21-05-2023
12
+ Designed for : HuggingFace - Open Source Community.
13
  """
14
 
15
  # Import the required libraries
 
394
 
395
  def make_code_interpreter_read_only(files=[],folders:str="lib"):
396
  for filename in files:
397
+ if os.path.exists(filename):
398
+ BardCoder.write_log(f"Making {filename} read-only")
399
+ os.chmod(filename, S_IREAD|S_IRGRP|S_IROTH)
400
+ else:
401
+ BardCoder.write_log(f"File {filename} does not exist")
402
 
403
  # Make all files in lib folder read-only
404
  BardCoder.write_log(f"Making all files in {folders} folder read-only")