RameshJ commited on
Commit
12e3ddb
·
verified ·
1 Parent(s): b010429

Update ocr_llm_utils.py

Browse files

handling write permissions

Files changed (1) hide show
  1. ocr_llm_utils.py +3 -2
ocr_llm_utils.py CHANGED
@@ -12,9 +12,10 @@ load_dotenv()
12
  # Save secret JSON string to a temporary file
13
  gcv_json_str = os.environ.get("GCV_JSON")
14
  if gcv_json_str:
15
- with open("gcv_temp.json", "w") as f:
 
16
  f.write(gcv_json_str)
17
- os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "gcv_temp.json"
18
 
19
  client = Groq(api_key=os.getenv("GROQ_API_KEY"))
20
 
 
12
  # Save secret JSON string to a temporary file
13
  gcv_json_str = os.environ.get("GCV_JSON")
14
  if gcv_json_str:
15
+ temp_path = "/tmp/gcv_temp.json"
16
+ with open("temp_path", "w") as f:
17
  f.write(gcv_json_str)
18
+ os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = temp_path
19
 
20
  client = Groq(api_key=os.getenv("GROQ_API_KEY"))
21