abdvl commited on
Commit
b138bed
1 Parent(s): 5ebe318

update the interface

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +4 -2
README.md CHANGED
@@ -28,7 +28,7 @@ streamlit run app.py
28
  3. Update the `os.environ["OPENAI_API_KEY"] ` in the `train.py`
29
  4. Run `python3 train.py`
30
 
31
- The training will take 15 seconds, and cost around $2.00
32
  ```
33
  chromadb.db.duckdb: loaded in 236 embeddings
34
  chromadb.db.duckdb: loaded in 1 collections
 
28
  3. Update the `os.environ["OPENAI_API_KEY"] ` in the `train.py`
29
  4. Run `python3 train.py`
30
 
31
+ The training will take 15 seconds, and cost around $0.20
32
  ```
33
  chromadb.db.duckdb: loaded in 236 embeddings
34
  chromadb.db.duckdb: loaded in 1 collections
app.py CHANGED
@@ -13,12 +13,14 @@ from langchain.callbacks import get_openai_callback
13
  # variables
14
  db_folder = "db"
15
  mode = "infer" # "train" or "infer"
16
-
17
  # set your OpenAI API key
18
  api_key = st.text_input('OPENAI API KEY')
19
  if api_key:
20
  os.environ["OPENAI_API_KEY"] = api_key
21
-
 
 
22
 
23
 
24
  # initialize the language model
 
13
  # variables
14
  db_folder = "db"
15
  mode = "infer" # "train" or "infer"
16
+ st.title('DataHub QA Chat Demo')
17
  # set your OpenAI API key
18
  api_key = st.text_input('OPENAI API KEY')
19
  if api_key:
20
  os.environ["OPENAI_API_KEY"] = api_key
21
+ else:
22
+ st.write("Please provide your OpenAI API KEY, the query is cheap ($0.0001 per query))")
23
+ exit()
24
 
25
 
26
  # initialize the language model