Update main.py
Browse files
main.py
CHANGED
@@ -18,19 +18,6 @@ from langchain.schema.runnable.config import RunnableConfig
|
|
18 |
from langchain.schema.runnable import Runnable, RunnablePassthrough, RunnableLambda
|
19 |
from langchain_core.prompts import PromptTemplate
|
20 |
|
21 |
-
os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
|
22 |
-
repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
23 |
-
|
24 |
-
llm = HuggingFaceEndpoint(
|
25 |
-
repo_id=repo_id, max_new_tokens=8000, temperature=1.0, task="text2text-generation", streaming=True
|
26 |
-
)
|
27 |
-
os.environ['PINECONE_API_KEY'] = os.environ['PINECONE_API_KEY']
|
28 |
-
embeddings = HuggingFaceEmbeddings()
|
29 |
-
index_name = "all-venus"
|
30 |
-
pc = Pinecone(
|
31 |
-
api_key=os.environ['PINECONE_API_KEY']
|
32 |
-
)
|
33 |
-
index = pc.Index(index_name)
|
34 |
@cl.password_auth_callback
|
35 |
def auth_callback(username: str, password: str):
|
36 |
auth = json.loads(os.environ['CHAINLIT_AUTH_LOGIN'])
|
@@ -62,6 +49,19 @@ async def chat_profile():
|
|
62 |
|
63 |
@cl.on_chat_start
|
64 |
async def on_chat_start():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
await cl.Message(f"> REVIEWSTREAM").send()
|
66 |
await cl.Message(f"Nous avons le plaisir de vous accueillir dans l'application de recherche et d'analyse des publications.").send()
|
67 |
listPrompts_name = f"Liste des revues de recherche"
|
|
|
18 |
from langchain.schema.runnable import Runnable, RunnablePassthrough, RunnableLambda
|
19 |
from langchain_core.prompts import PromptTemplate
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
@cl.password_auth_callback
|
22 |
def auth_callback(username: str, password: str):
|
23 |
auth = json.loads(os.environ['CHAINLIT_AUTH_LOGIN'])
|
|
|
49 |
|
50 |
@cl.on_chat_start
|
51 |
async def on_chat_start():
|
52 |
+
os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
|
53 |
+
repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
54 |
+
|
55 |
+
llm = HuggingFaceEndpoint(
|
56 |
+
repo_id=repo_id, max_new_tokens=8000, temperature=1.0, task="text2text-generation", streaming=True
|
57 |
+
)
|
58 |
+
os.environ['PINECONE_API_KEY'] = os.environ['PINECONE_API_KEY']
|
59 |
+
embeddings = HuggingFaceEmbeddings()
|
60 |
+
index_name = "all-venus"
|
61 |
+
pc = Pinecone(
|
62 |
+
api_key=os.environ['PINECONE_API_KEY']
|
63 |
+
)
|
64 |
+
index = pc.Index(index_name)
|
65 |
await cl.Message(f"> REVIEWSTREAM").send()
|
66 |
await cl.Message(f"Nous avons le plaisir de vous accueillir dans l'application de recherche et d'analyse des publications.").send()
|
67 |
listPrompts_name = f"Liste des revues de recherche"
|