mobenta commited on
Commit
46e62a6
·
verified ·
1 Parent(s): 09b7e14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -1,13 +1,16 @@
 
1
  import gradio as gr
2
  import cohere
3
  from docx import Document
4
  from docx.shared import Pt
5
  from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
6
  import pypandoc
7
- import os
8
 
9
- # Initialize Cohere client with your API key
10
- cohere_api_key = '' # Replace with your actual Cohere API key
 
 
 
11
  co = cohere.Client(cohere_api_key)
12
 
13
  def generate_body(job_description, language):
 
1
+ import os
2
  import gradio as gr
3
  import cohere
4
  from docx import Document
5
  from docx.shared import Pt
6
  from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
7
  import pypandoc
 
8
 
9
+ # Initialize Cohere client with your API key from environment variable
10
+ cohere_api_key = os.getenv('COHERE_API_KEY') # Fetch the API key from environment variables
11
+ if not cohere_api_key:
12
+ raise ValueError("Cohere API key not found. Please set the 'COHERE_API_KEY' environment variable.")
13
+
14
  co = cohere.Client(cohere_api_key)
15
 
16
  def generate_body(job_description, language):