Update main.py
Browse files
main.py
CHANGED
@@ -7,7 +7,6 @@ from typing import List
|
|
7 |
from pathlib import Path
|
8 |
|
9 |
from langchain_huggingface import HuggingFaceEndpoint
|
10 |
-
from langchain_community.chat_models.huggingface import ChatHuggingFace
|
11 |
|
12 |
from langchain_openai import ChatOpenAI, OpenAI
|
13 |
from langchain.schema.runnable.config import RunnableConfig
|
@@ -69,10 +68,9 @@ def create_agent(filename: str):
|
|
69 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
|
70 |
|
71 |
repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
72 |
-
|
73 |
repo_id=repo_id, task="text2text-generation", max_new_tokens=8000, temperature=0.01, streaming=True
|
74 |
)
|
75 |
-
llm = ChatHuggingFace(llm=model_llm)
|
76 |
# Read the CSV file into a Pandas DataFrame.
|
77 |
if cl.user_session.get("createdb") == None:
|
78 |
df = pd.read_csv(filename)
|
|
|
7 |
from pathlib import Path
|
8 |
|
9 |
from langchain_huggingface import HuggingFaceEndpoint
|
|
|
10 |
|
11 |
from langchain_openai import ChatOpenAI, OpenAI
|
12 |
from langchain.schema.runnable.config import RunnableConfig
|
|
|
68 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
|
69 |
|
70 |
repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
71 |
+
llm = HuggingFaceEndpoint(
|
72 |
repo_id=repo_id, task="text2text-generation", max_new_tokens=8000, temperature=0.01, streaming=True
|
73 |
)
|
|
|
74 |
# Read the CSV file into a Pandas DataFrame.
|
75 |
if cl.user_session.get("createdb") == None:
|
76 |
df = pd.read_csv(filename)
|