init
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def load_recommender(path, start_page=1):
|
|
34 |
def generate_text(prompt, model = "gpt-3.5-turbo-16k-0613"):
|
35 |
|
36 |
model="mistralai/Mixtral-8x7B-Instruct-v0.1"
|
37 |
-
max_tokens=
|
38 |
message = clinet.chat.completions.create(
|
39 |
model=model,
|
40 |
messages=[
|
@@ -52,7 +52,9 @@ def generate_answer(question):
|
|
52 |
|
53 |
prompt += "Instructions: Compose a comprehensive reply to the query using the search results given. "\
|
54 |
"Cite each reference using [ Page Number] notation. "\
|
55 |
-
"Only answer what is asked. The answer should be short and concise. \
|
|
|
|
|
56 |
|
57 |
prompt += f"{question}\nAnswer:"
|
58 |
answer = generate_text(prompt)
|
|
|
34 |
def generate_text(prompt, model = "gpt-3.5-turbo-16k-0613"):
|
35 |
|
36 |
model="mistralai/Mixtral-8x7B-Instruct-v0.1"
|
37 |
+
max_tokens=1024
|
38 |
message = clinet.chat.completions.create(
|
39 |
model=model,
|
40 |
messages=[
|
|
|
52 |
|
53 |
prompt += "Instructions: Compose a comprehensive reply to the query using the search results given. "\
|
54 |
"Cite each reference using [ Page Number] notation. "\
|
55 |
+
"Only answer what is asked. The answer should be short and concise. "\
|
56 |
+
"If asked in Chinese, respond in Chinese; if asked in English, respond"\
|
57 |
+
"in English \n\nQuery: "
|
58 |
|
59 |
prompt += f"{question}\nAnswer:"
|
60 |
answer = generate_text(prompt)
|