Ravi theja K commited on
Commit
84fe25b
·
verified ·
1 Parent(s): 61445b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,7 +3,7 @@ import streamlit as st
3
  from snowflake.snowpark import Session
4
  from snowflake.ml.utils.connection_params import SnowflakeLoginOptions
5
  from langchain_community.utilities import SQLDatabase
6
- from langchain_openai import OpenAI
7
  from langchain.chains import create_sql_query_chain
8
 
9
  @st.cache_resource(show_spinner="Connecting...")
@@ -18,8 +18,8 @@ def getSession():
18
  + f"?warehouse={pars['warehouse']}&role={pars['role']}")
19
  db = SQLDatabase.from_uri(url)
20
 
21
- openai_key = os.environ["OPENAI_API_KEY"]
22
- llm = OpenAI(openai_api_key=openai_key)
23
  chain = create_sql_query_chain(llm, db)
24
  return session, db, chain
25
 
 
3
  from snowflake.snowpark import Session
4
  from snowflake.ml.utils.connection_params import SnowflakeLoginOptions
5
  from langchain_community.utilities import SQLDatabase
6
+ from langchain_llms import HuggingFaceHub
7
  from langchain.chains import create_sql_query_chain
8
 
9
  @st.cache_resource(show_spinner="Connecting...")
 
18
  + f"?warehouse={pars['warehouse']}&role={pars['role']}")
19
  db = SQLDatabase.from_uri(url)
20
 
21
+ os.environ["HUGGINGFACEHUB_API_TOKEN"] = ""
22
+ llm = HuggingFaceHub(repo_id= "ravithejakandi/Sf-Arctic-Demo-Enu")
23
  chain = create_sql_query_chain(llm, db)
24
  return session, db, chain
25