qunfei commited on
Commit
963c94c
Β·
1 Parent(s): 8cb6721

adding input key

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -10,11 +10,14 @@ st.set_page_config(
10
  )
11
 
12
  databases = ['Oracle', 'SQLServer', 'MySQL', 'DB2', 'PostgreSQL', 'Snowflake', 'Redshift']
 
 
13
  # -------------
14
 
15
  st.sidebar.header('πŸŽƒ A SQL Transformer for Migration')
16
 
17
- model = st.sidebar.radio('Model', ['openai-text-david-003', 'google-t5', 'facebook-llama'])
 
18
 
19
  source_database = st.sidebar.selectbox(
20
  label='πŸ“• Source Database',
@@ -42,7 +45,7 @@ input_file = st.sidebar.file_uploader(
42
  def transform():
43
  client: SQLService = None
44
  if model == "openai-text-david-003":
45
- client = OpenAIService(st.secrets("OPEN-ORG"), st.secrets("OPEN-KEY"))
46
  elif model == "google-t5":
47
  client = GoogleT5Service()
48
  elif model == "facebook-llama":
 
10
  )
11
 
12
  databases = ['Oracle', 'SQLServer', 'MySQL', 'DB2', 'PostgreSQL', 'Snowflake', 'Redshift']
13
+
14
+ models = ['openai-text-david-003', 'google-t5', 'facebook-llama']
15
  # -------------
16
 
17
  st.sidebar.header('πŸŽƒ A SQL Transformer for Migration')
18
 
19
+ model = st.sidebar.selectbox(label='Model', options=models, index=0)
20
+ openai_key = st.sidebar.text_input("Openai Key", placeholder="No Key, No translate")
21
 
22
  source_database = st.sidebar.selectbox(
23
  label='πŸ“• Source Database',
 
45
  def transform():
46
  client: SQLService = None
47
  if model == "openai-text-david-003":
48
+ client = OpenAIService(openai_key)
49
  elif model == "google-t5":
50
  client = GoogleT5Service()
51
  elif model == "facebook-llama":