NCTCMumbai
commited on
Commit
•
ab9cd93
1
Parent(s):
32edcc4
Update backend/query_llm.py
Browse files- backend/query_llm.py +9 -5
backend/query_llm.py
CHANGED
@@ -9,8 +9,8 @@ from typing import Any, Dict, Generator, List
|
|
9 |
from huggingface_hub import InferenceClient
|
10 |
from transformers import AutoTokenizer
|
11 |
|
12 |
-
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1")
|
13 |
-
|
14 |
temperature = 0.9
|
15 |
top_p = 0.6
|
16 |
repetition_penalty = 1.2
|
@@ -18,12 +18,16 @@ repetition_penalty = 1.2
|
|
18 |
OPENAI_KEY = getenv("OPENAI_API_KEY")
|
19 |
HF_TOKEN = getenv("HUGGING_FACE_HUB_TOKEN")
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
hf_client = InferenceClient(
|
22 |
-
"mistralai/
|
23 |
token=HF_TOKEN
|
24 |
)
|
25 |
-
|
26 |
-
|
27 |
def format_prompt(message: str, api_kind: str):
|
28 |
"""
|
29 |
Formats the given message using a chat template.
|
|
|
9 |
from huggingface_hub import InferenceClient
|
10 |
from transformers import AutoTokenizer
|
11 |
|
12 |
+
#tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1")
|
13 |
+
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
14 |
temperature = 0.9
|
15 |
top_p = 0.6
|
16 |
repetition_penalty = 1.2
|
|
|
18 |
OPENAI_KEY = getenv("OPENAI_API_KEY")
|
19 |
HF_TOKEN = getenv("HUGGING_FACE_HUB_TOKEN")
|
20 |
|
21 |
+
#hf_client = InferenceClient(
|
22 |
+
# "mistralai/Mistral-7B-Instruct-v0.1",
|
23 |
+
# token=HF_TOKEN
|
24 |
+
# )
|
25 |
+
|
26 |
+
|
27 |
hf_client = InferenceClient(
|
28 |
+
"mistralai/Mixtral-8x7B-Instruct-v0.1",
|
29 |
token=HF_TOKEN
|
30 |
)
|
|
|
|
|
31 |
def format_prompt(message: str, api_kind: str):
|
32 |
"""
|
33 |
Formats the given message using a chat template.
|