Chong-U Lim commited on
Commit
90cf4ba
·
1 Parent(s): dd6a1d5

Prepare for hf space

Browse files
Files changed (1) hide show
  1. langchain_helper.py +6 -2
langchain_helper.py CHANGED
@@ -1,10 +1,14 @@
1
  import os
2
- from keys import openapi_key
3
  from langchain.llms import OpenAI
4
  from langchain.prompts import PromptTemplate
5
  from langchain.chains import LLMChain, SequentialChain
6
 
7
- os.environ["OPENAI_API_KEY"] = openapi_key
 
 
 
 
8
  llm = OpenAI(temperature=0.7)
9
 
10
  prompt_template_name = PromptTemplate(
 
1
  import os
2
+
3
  from langchain.llms import OpenAI
4
  from langchain.prompts import PromptTemplate
5
  from langchain.chains import LLMChain, SequentialChain
6
 
7
+ if "OPENAI_API_KEY" not in os.environ:
8
+ from keys import openapi_key
9
+
10
+ os.environ["OPENAI_API_KEY"] = openapi_key
11
+
12
  llm = OpenAI(temperature=0.7)
13
 
14
  prompt_template_name = PromptTemplate(