Spaces:
Runtime error
Runtime error
Update ns_updyoga.py
Browse files- ns_updyoga.py +4 -3
ns_updyoga.py
CHANGED
|
@@ -12,8 +12,9 @@ from langchain.callbacks import StdOutCallbackHandler
|
|
| 12 |
def setup(openai_key):
|
| 13 |
# Set the API key for OpenAI
|
| 14 |
os.environ["OPENAI_API_KEY"] = openai_key
|
|
|
|
| 15 |
retriver = create_index()
|
| 16 |
-
return retriver
|
| 17 |
|
| 18 |
def create_index():
|
| 19 |
# load the data
|
|
@@ -39,8 +40,8 @@ def create_index():
|
|
| 39 |
def yg_assistant(openai_key,query):
|
| 40 |
|
| 41 |
# Setup
|
| 42 |
-
llm =
|
| 43 |
-
|
| 44 |
# Create the QA chain
|
| 45 |
handler = StdOutCallbackHandler()
|
| 46 |
|
|
|
|
| 12 |
def setup(openai_key):
|
| 13 |
# Set the API key for OpenAI
|
| 14 |
os.environ["OPENAI_API_KEY"] = openai_key
|
| 15 |
+
llm = ChatOpenAI(model="gpt-4")
|
| 16 |
retriver = create_index()
|
| 17 |
+
return retriver, llm
|
| 18 |
|
| 19 |
def create_index():
|
| 20 |
# load the data
|
|
|
|
| 40 |
def yg_assistant(openai_key,query):
|
| 41 |
|
| 42 |
# Setup
|
| 43 |
+
retriever, llm = setup(openai_key)
|
| 44 |
+
|
| 45 |
# Create the QA chain
|
| 46 |
handler = StdOutCallbackHandler()
|
| 47 |
|