datacipen commited on
Commit
83bcf79
1 Parent(s): a92515d

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -13
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
- #model = HuggingFaceEndpoint(
435
- # repo_id=repo_id,
436
- # max_new_tokens=6000,
437
- # temperature=1.0,
438
- # streaming=True
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", "")