Update main.py
Browse files
main.py
CHANGED
|
@@ -396,7 +396,9 @@ async def start():
|
|
| 396 |
async def construction_NCS(competenceList):
|
| 397 |
context = await contexte(competenceList)
|
| 398 |
emploisST = context.to_string(index = False)
|
| 399 |
-
|
|
|
|
|
|
|
| 400 |
romeListArray = cl.user_session.get("codeRomeArray")
|
| 401 |
listEmplois = context.values.tolist()
|
| 402 |
stringEmplois = ''
|
|
@@ -429,7 +431,6 @@ async def construction_NCS(competenceList):
|
|
| 429 |
).send()
|
| 430 |
|
| 431 |
await cl.sleep(1)
|
| 432 |
-
ficheClesMetier = await document_chiffres_cles_emplois("https://dataemploi.francetravail.fr/metier/chiffres-cles/NAT/FR/", romeListArray)
|
| 433 |
listClesMetier_name = f"Chiffres clés des emplois"
|
| 434 |
text_ClesMetier = []
|
| 435 |
text_ClesMetier.append(
|
|
@@ -775,7 +776,6 @@ async def connexion_catalogue_Rome():
|
|
| 775 |
@cl.step(type="llm")
|
| 776 |
async def IA():
|
| 777 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
|
| 778 |
-
#repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 779 |
repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
|
| 780 |
|
| 781 |
llm = HuggingFaceEndpoint(
|
|
@@ -817,7 +817,7 @@ async def setup_agent(settings):
|
|
| 817 |
|
| 818 |
model = HuggingFaceEndpoint(
|
| 819 |
repo_id=repo_id,
|
| 820 |
-
max_new_tokens=
|
| 821 |
temperature=0.5,
|
| 822 |
streaming=True
|
| 823 |
)
|
|
|
|
| 396 |
async def construction_NCS(competenceList):
|
| 397 |
context = await contexte(competenceList)
|
| 398 |
emploisST = context.to_string(index = False)
|
| 399 |
+
ficheClesMetier = await document_chiffres_cles_emplois("https://dataemploi.francetravail.fr/metier/chiffres-cles/NAT/FR/", romeListArray)
|
| 400 |
+
contentChatBot = emploisST + ficheClesMetier
|
| 401 |
+
cl.user_session.set("contextChatBot", contentChatBot[0:28875])
|
| 402 |
romeListArray = cl.user_session.get("codeRomeArray")
|
| 403 |
listEmplois = context.values.tolist()
|
| 404 |
stringEmplois = ''
|
|
|
|
| 431 |
).send()
|
| 432 |
|
| 433 |
await cl.sleep(1)
|
|
|
|
| 434 |
listClesMetier_name = f"Chiffres clés des emplois"
|
| 435 |
text_ClesMetier = []
|
| 436 |
text_ClesMetier.append(
|
|
|
|
| 776 |
@cl.step(type="llm")
|
| 777 |
async def IA():
|
| 778 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
|
|
|
|
| 779 |
repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
|
| 780 |
|
| 781 |
llm = HuggingFaceEndpoint(
|
|
|
|
| 817 |
|
| 818 |
model = HuggingFaceEndpoint(
|
| 819 |
repo_id=repo_id,
|
| 820 |
+
max_new_tokens=3600,
|
| 821 |
temperature=0.5,
|
| 822 |
streaming=True
|
| 823 |
)
|