pragneshbarik commited on
Commit
cf23c49
1 Parent(s): d466514

updated readme

Browse files
Files changed (2) hide show
  1. README.md +31 -0
  2. app.py +4 -0
README.md CHANGED
@@ -11,3 +11,34 @@ license: mit
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
14
+
15
+
16
+ # Setup
17
+
18
+ 1. Clone this repo
19
+ 2. Create and activate a new virtual environment, using either `conda` or `venv`
20
+
21
+ > [Tutorial for setting up virtual environments 🔗](https://www.perplexity.ai/search/how-to-make-GnFc09yGTvSyka0ZWqhSQg?s=c)
22
+
23
+ 3. Make a .env file, for storing api credentials, currently using these 4 credentials.
24
+ ```
25
+ HF_TOKEN = ...
26
+ GOOGLE_SEARCH_ENGINE_ID = ...
27
+ GOOGLE_SEARCH_API_KEY = ...
28
+ BING_SEARCH_API_KEY = ...
29
+
30
+ ```
31
+
32
+ 4. Install requirements using
33
+ ```
34
+ pip install -r requirements.txt --user
35
+ ```
36
+ 5. Startup streamlit server by using
37
+ ```
38
+ streamlit run app.py
39
+ ```
40
+ or
41
+ ```
42
+ python -m streamlit run app.py
43
+ ```
44
+
app.py CHANGED
@@ -5,6 +5,10 @@ from utils import gen_augmented_prompt_via_websearch, inital_prompt_engineering_
5
 
6
 
7
  COST_PER_1000_TOKENS_USD = 0.139 * 80
 
 
 
 
8
  CHAT_BOTS = {
9
  "Mixtral 8x7B v0.1": "mistralai/Mixtral-8x7B-Instruct-v0.1",
10
  "Mistral 7B v0.1": "mistralai/Mistral-7B-Instruct-v0.1",
 
5
 
6
 
7
  COST_PER_1000_TOKENS_USD = 0.139 * 80
8
+
9
+ # Not using BPE tokenizer to calculate exact number of tokens,
10
+ # using the formula n_tokens = len(reponse + prompt) * 1.25
11
+
12
  CHAT_BOTS = {
13
  "Mixtral 8x7B v0.1": "mistralai/Mixtral-8x7B-Instruct-v0.1",
14
  "Mistral 7B v0.1": "mistralai/Mistral-7B-Instruct-v0.1",