SwatGarg commited on
Commit
9435ab2
1 Parent(s): 5be2189

Update generator.py

Browse files
Files changed (1) hide show
  1. generator.py +2 -2
generator.py CHANGED
@@ -2,7 +2,7 @@ import os
2
  from langchain_community.llms import HuggingFaceEndpoint
3
  from pydantic import ValidationError
4
 
5
- def load_llm(repo_id="mistralai/Mistral-7B-Instruct-v0.2"):
6
  '''
7
  Load the LLM from the HuggingFace model hub
8
  Args:
@@ -14,7 +14,7 @@ def load_llm(repo_id="mistralai/Mistral-7B-Instruct-v0.2"):
14
  try:
15
  api_token = os.getenv("HUGGINGFACE_API_TOKEN")
16
  llm = HuggingFaceEndpoint(
17
- repo_id=repo_id, max_length=128, temperature=0.2, api_token=api_token)
18
  return llm
19
  except ValidationError as e:
20
  print("Validation Error:", e)
 
2
  from langchain_community.llms import HuggingFaceEndpoint
3
  from pydantic import ValidationError
4
 
5
+ def load_llm(repo_id="mistralai/Mistral-7B-Instruct-v0.2", token):
6
  '''
7
  Load the LLM from the HuggingFace model hub
8
  Args:
 
14
  try:
15
  api_token = os.getenv("HUGGINGFACE_API_TOKEN")
16
  llm = HuggingFaceEndpoint(
17
+ repo_id=repo_id, max_length=128, temperature=0.2, token=api_token)
18
  return llm
19
  except ValidationError as e:
20
  print("Validation Error:", e)