rishisim commited on
Commit
86ae097
1 Parent(s): f087128

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -6,9 +6,9 @@ hftoken = os.environ["hftoken"]
6
 
7
  from langchain_huggingface import HuggingFaceEndpoint
8
 
9
- repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
10
  # repo_id = "google/gemma-2-9b-it"
11
- # repo_id = "meta-llama/Meta-Llama-3-8B-Instruct" # answers the question well, but continues the text and does not stop when its necessary. often ends in incomplete responses.
12
  # repo_id = "mistralai/Mixtral-8x22B-Instruct-v0.1"
13
  llm = HuggingFaceEndpoint(repo_id = repo_id, max_new_tokens = 128, temperature = 0.7, huggingfacehub_api_token = hftoken)
14
 
@@ -39,7 +39,7 @@ from langchain_core.prompts import ChatPromptTemplate
39
 
40
  prompt = ChatPromptTemplate.from_template("""Given the following context and a question, generate an answer based on the provided context only.
41
 
42
- In your answer, try to use as much text as possible from the "response" section in the source document context.
43
  If someone asks "Who are you?" or a similar question, reply with "I am Rishi's assistant built using a Large Language Model!"
44
  If the answer is not found in the context, kindly state "I don't know. Please ask Rishi on Discord at https://discord.gg/6ezpZGeCcM or email [email protected]." Do not attempt to make up an answer.
45
 
 
6
 
7
  from langchain_huggingface import HuggingFaceEndpoint
8
 
9
+ # repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
10
  # repo_id = "google/gemma-2-9b-it"
11
+ repo_id = "meta-llama/Meta-Llama-3-8B-Instruct" # answers the question well, but continues the text and does not stop when its necessary. often ends in incomplete responses.
12
  # repo_id = "mistralai/Mixtral-8x22B-Instruct-v0.1"
13
  llm = HuggingFaceEndpoint(repo_id = repo_id, max_new_tokens = 128, temperature = 0.7, huggingfacehub_api_token = hftoken)
14
 
 
39
 
40
  prompt = ChatPromptTemplate.from_template("""Given the following context and a question, generate an answer based on the provided context only.
41
 
42
+ In your answer, try to use as much text as possible from the "response" section in the source document context without making significant changes.
43
  If someone asks "Who are you?" or a similar question, reply with "I am Rishi's assistant built using a Large Language Model!"
44
  If the answer is not found in the context, kindly state "I don't know. Please ask Rishi on Discord at https://discord.gg/6ezpZGeCcM or email [email protected]." Do not attempt to make up an answer.
45