Spaces:
Runtime error
Runtime error
Haseeb
commited on
Commit
•
e8cd164
1
Parent(s):
c9f55e2
Refactor
Browse files- bardcode_interpreter.py +2 -9
bardcode_interpreter.py
CHANGED
@@ -12,8 +12,6 @@ Date : 21-05-2023
|
|
12 |
"""
|
13 |
|
14 |
# Import the required libraries
|
15 |
-
import logging
|
16 |
-
import sys
|
17 |
import streamlit as st
|
18 |
from os import path
|
19 |
import time
|
@@ -395,10 +393,8 @@ import os
|
|
395 |
from stat import S_IREAD, S_IRGRP, S_IROTH
|
396 |
|
397 |
def make_code_interpreter_read_only():
|
398 |
-
# Make code_interpreter.py read-only
|
399 |
-
# how to filename of this file
|
400 |
filename = __file__
|
401 |
-
BardCoder.
|
402 |
os.chmod(filename, S_IREAD|S_IRGRP|S_IROTH)
|
403 |
|
404 |
# Make all files in lib folder read-only
|
@@ -497,8 +493,7 @@ if __name__ == "__main__":
|
|
497 |
except Exception as e:
|
498 |
BardCoder.write_log(f"Error in options {e}")
|
499 |
|
500 |
-
|
501 |
-
|
502 |
with st.expander("Settings"):
|
503 |
bard_key_help_text = """
|
504 |
How to obtain Google Bard API key.
|
@@ -524,7 +519,6 @@ if __name__ == "__main__":
|
|
524 |
st.error("Error initializing Bard Coder")
|
525 |
|
526 |
|
527 |
-
|
528 |
# Setting advanced options for the application
|
529 |
with st.expander("Advanced"):
|
530 |
try:
|
@@ -562,7 +556,6 @@ if __name__ == "__main__":
|
|
562 |
|
563 |
# Setting application to run
|
564 |
if run_button:
|
565 |
-
# Code to execute when the "Run" button is clicked
|
566 |
|
567 |
# Check if API Key is empty
|
568 |
if bard_api_key is None or bard_api_key == "" or bard_api_key.__len__() == 0:
|
|
|
12 |
"""
|
13 |
|
14 |
# Import the required libraries
|
|
|
|
|
15 |
import streamlit as st
|
16 |
from os import path
|
17 |
import time
|
|
|
393 |
from stat import S_IREAD, S_IRGRP, S_IROTH
|
394 |
|
395 |
def make_code_interpreter_read_only():
|
|
|
|
|
396 |
filename = __file__
|
397 |
+
BardCoder.write_log(f"Making {filename} read-only")
|
398 |
os.chmod(filename, S_IREAD|S_IRGRP|S_IROTH)
|
399 |
|
400 |
# Make all files in lib folder read-only
|
|
|
493 |
except Exception as e:
|
494 |
BardCoder.write_log(f"Error in options {e}")
|
495 |
|
496 |
+
# Adding settings for the application
|
|
|
497 |
with st.expander("Settings"):
|
498 |
bard_key_help_text = """
|
499 |
How to obtain Google Bard API key.
|
|
|
519 |
st.error("Error initializing Bard Coder")
|
520 |
|
521 |
|
|
|
522 |
# Setting advanced options for the application
|
523 |
with st.expander("Advanced"):
|
524 |
try:
|
|
|
556 |
|
557 |
# Setting application to run
|
558 |
if run_button:
|
|
|
559 |
|
560 |
# Check if API Key is empty
|
561 |
if bard_api_key is None or bard_api_key == "" or bard_api_key.__len__() == 0:
|