cmagganas commited on
Commit
dc52018
1 Parent(s): a13da0d

Upload folder using huggingface_hub

Browse files
app/__pycache__/openai_chat_completion.cpython-310.pyc CHANGED
Binary files a/app/__pycache__/openai_chat_completion.cpython-310.pyc and b/app/__pycache__/openai_chat_completion.cpython-310.pyc differ
 
app/openai_chat_completion.py CHANGED
@@ -90,10 +90,15 @@ class OpenAIChatCompletions:
90
  ):
91
 
92
  # jsonObj = pd.read_json(path_or_buf=path_or_buf, lines=True)
93
- if "streamlit" in os.getcwd():
94
- file_path = os.path.join(os.getcwd(), "..", path_or_buf)
 
 
 
 
95
  else:
96
- file_path = "/home/user/app/" + path_or_buf
 
97
 
98
  try:
99
  with open(file_path, "r") as file:
 
90
  ):
91
 
92
  # jsonObj = pd.read_json(path_or_buf=path_or_buf, lines=True)
93
+
94
+ # if running locally, True
95
+ # else running on HF Spaces, False
96
+ if "Kaleidoscope Data" in os.getcwd():
97
+ # file_path = os.path.join(os.getcwd(), "..", path_or_buf)
98
+ file_path = os.path.join("/".join(os.getcwd().split('/')[:-1]), path_or_buf)
99
  else:
100
+ file_path = os.path.join(os.getcwd(), path_or_buf)
101
+
102
 
103
  try:
104
  with open(file_path, "r") as file: