RameshJ commited on
Commit
100a2d3
·
verified ·
1 Parent(s): 8fb878c

Update ocr_llm_utils.py

Browse files

edited gcv secrets handling

Files changed (1) hide show
  1. ocr_llm_utils.py +7 -1
ocr_llm_utils.py CHANGED
@@ -7,7 +7,13 @@ from groq import Groq
7
  load_dotenv()
8
 
9
  # Load credentials from env variable
10
- os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = os.getenv("GCP_KEY_PATH")
 
 
 
 
 
 
11
 
12
  client = Groq(api_key=os.getenv("GROQ_API_KEY"))
13
 
 
7
  load_dotenv()
8
 
9
  # Load credentials from env variable
10
+
11
+ # Save secret JSON string to a temporary file
12
+ gcv_json_str = os.environ.get("GCV_JSON")
13
+ if gcv_json_str:
14
+ with open("gcv_temp.json", "w") as f:
15
+ f.write(gcv_json_str)
16
+ os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "gcv_temp.json"
17
 
18
  client = Groq(api_key=os.getenv("GROQ_API_KEY"))
19