Update main.py
Browse files
main.py
CHANGED
@@ -431,19 +431,12 @@ async def start():
|
|
431 |
|
432 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
|
433 |
#repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
from huggingface_hub import login
|
441 |
-
from langchain_huggingface.llms import HuggingFacePipeline
|
442 |
-
login(token=os.environ['HUGGINGFACEHUB_API_TOKEN'])
|
443 |
-
model = HuggingFacePipeline.from_model_id(
|
444 |
-
model_id="mistralai/Mistral-Small-Instruct-2409",
|
445 |
-
task="text-generation",
|
446 |
-
pipeline_kwargs={"max_new_tokens": 10},
|
447 |
)
|
448 |
if not cl.user_session.get("saveMemory"):
|
449 |
cl.user_session.set("saveMemory", "")
|
|
|
431 |
|
432 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = os.environ['HUGGINGFACEHUB_API_TOKEN']
|
433 |
#repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
|
434 |
+
repo_id = "mistralai/Mistral-Small-Instruct-2409"
|
435 |
+
model = HuggingFaceEndpoint(
|
436 |
+
repo_id=repo_id,
|
437 |
+
max_new_tokens=6000,
|
438 |
+
temperature=1.0,
|
439 |
+
streaming=True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
)
|
441 |
if not cl.user_session.get("saveMemory"):
|
442 |
cl.user_session.set("saveMemory", "")
|