Spaces:
Sleeping
Sleeping
Update pages/2_Chatbot_AR.py
Browse files- pages/2_Chatbot_AR.py +19 -3
pages/2_Chatbot_AR.py
CHANGED
@@ -16,6 +16,9 @@ import pysqlite3
|
|
16 |
import sys
|
17 |
sys.modules["sqlite3"] = pysqlite3
|
18 |
|
|
|
|
|
|
|
19 |
#####################
|
20 |
# 1. HELPER FUNCTIONS
|
21 |
#####################
|
@@ -200,9 +203,12 @@ prompt_template_ar = PromptTemplate(
|
|
200 |
|
201 |
# Configuration du LLM HuggingFace (AR)
|
202 |
#os.environ["HUGGINGFACEHUB_API"]
|
203 |
-
|
204 |
-
|
205 |
-
|
|
|
|
|
|
|
206 |
model_kwargs={
|
207 |
"temperature": 0.5,
|
208 |
"max_length": 500,
|
@@ -210,6 +216,16 @@ llm_ar = HuggingFaceHub(
|
|
210 |
}
|
211 |
)
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
# Chaîne AR
|
214 |
llm_chain_ar = LLMChain(llm=llm_ar, prompt=prompt_template_ar)
|
215 |
|
|
|
16 |
import sys
|
17 |
sys.modules["sqlite3"] = pysqlite3
|
18 |
|
19 |
+
####
|
20 |
+
from langchain_openai import ChatOpenAI
|
21 |
+
|
22 |
#####################
|
23 |
# 1. HELPER FUNCTIONS
|
24 |
#####################
|
|
|
203 |
|
204 |
# Configuration du LLM HuggingFace (AR)
|
205 |
#os.environ["HUGGINGFACEHUB_API"]
|
206 |
+
from langchain_openai import ChatOpenAI
|
207 |
+
|
208 |
+
llm_ar = ChatOpenAI(
|
209 |
+
model="Atlas-Chat-9B",
|
210 |
+
base_url="https://api.friendli.ai/serverless/v1",
|
211 |
+
api_key=os.environ["FRIENDLI_TOKEN"],
|
212 |
model_kwargs={
|
213 |
"temperature": 0.5,
|
214 |
"max_length": 500,
|
|
|
216 |
}
|
217 |
)
|
218 |
|
219 |
+
# llm_ar = HuggingFaceHub(
|
220 |
+
# repo_id="MBZUAI-Paris/Atlas-Chat-2B", #"MBZUAI-Paris/Atlas-Chat-9B",
|
221 |
+
# huggingfacehub_api_token=os.environ["HUGGINGFACEHUB_API"],
|
222 |
+
# model_kwargs={
|
223 |
+
# "temperature": 0.5,
|
224 |
+
# "max_length": 500,
|
225 |
+
# "timeout": 600
|
226 |
+
# }
|
227 |
+
# )
|
228 |
+
|
229 |
# Chaîne AR
|
230 |
llm_chain_ar = LLMChain(llm=llm_ar, prompt=prompt_template_ar)
|
231 |
|