tomascufaro commited on
Commit
47b7108
1 Parent(s): 0911828
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,7 +4,7 @@ from langchain.chains import create_extraction_chain
4
  from langchain.chat_models import ChatOpenAI
5
  from langchain.prompts import ChatPromptTemplate
6
  import gradio as gr
7
-
8
 
9
  # Schema
10
  schema = {
@@ -35,7 +35,7 @@ prompt_no_cat = ChatPromptTemplate.from_messages(
35
  ]
36
  )
37
 
38
- llm = ChatOpenAI(temperature=0, openai_api_key=APIkeys.OpenAI_APIKEY, model="gpt-3.5-turbo")
39
  chain = create_extraction_chain(schema, llm, prompt, verbose=1)
40
  chain_no_cat = create_extraction_chain(schema, llm, prompt_no_cat, verbose=1)
41
 
 
4
  from langchain.chat_models import ChatOpenAI
5
  from langchain.prompts import ChatPromptTemplate
6
  import gradio as gr
7
+ import os
8
 
9
  # Schema
10
  schema = {
 
35
  ]
36
  )
37
 
38
+ llm = ChatOpenAI(temperature=0, openai_api_key=os.getenv("OpenAI_APIKEY"), model="gpt-3.5-turbo")
39
  chain = create_extraction_chain(schema, llm, prompt, verbose=1)
40
  chain_no_cat = create_extraction_chain(schema, llm, prompt_no_cat, verbose=1)
41