JBHF commited on
Commit
0a26135
·
verified ·
1 Parent(s): 3da018d

Update crew.py

Browse files
Files changed (1) hide show
  1. crew.py +22 -1
crew.py CHANGED
@@ -55,7 +55,7 @@ class NewsletterGenCrew:
55
  #
56
  # BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your credit balance is too low to access the Claude API. Please go to Plans & Billing to upgrade or purchase credits.'}}
57
 
58
- llm = ChatGroq(model="llama3-70b-8192")
59
  # https://console.groq.com/docs/rate-limits
60
  # llm = ChatGroq(model="mixtral-8x7b-32768") # JB 13-06-2024 - geeft af en toe rate limit errors
61
  # IN HF SPACES STREAMLIT APP: BadRequestError: Error code: 400 - {'error': {'message': 'Organization has been restricted. Please reach out to support if you believe this was in error.', 'type': 'invalid_request_error', 'code': 'organization_restricted'}}
@@ -86,6 +86,27 @@ class NewsletterGenCrew:
86
  # https://github.com/ollama/ollama/issues/2833
87
 
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  print("JB: in class NewsletterGenCrew - using llm: ", llm)
90
 
91
  return llm
 
55
  #
56
  # BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your credit balance is too low to access the Claude API. Please go to Plans & Billing to upgrade or purchase credits.'}}
57
 
58
+ # llm = ChatGroq(model="llama3-70b-8192")
59
  # https://console.groq.com/docs/rate-limits
60
  # llm = ChatGroq(model="mixtral-8x7b-32768") # JB 13-06-2024 - geeft af en toe rate limit errors
61
  # IN HF SPACES STREAMLIT APP: BadRequestError: Error code: 400 - {'error': {'message': 'Organization has been restricted. Please reach out to support if you believe this was in error.', 'type': 'invalid_request_error', 'code': 'organization_restricted'}}
 
86
  # https://github.com/ollama/ollama/issues/2833
87
 
88
 
89
+ # HUGGING FACE LLMs
90
+ # https://python.langchain.com/v0.2/docs/integrations/chat/huggingface/
91
+ # HUGGINGFACEHUB_API_TOKEN
92
+ # https://huggingface.co/docs/hub/security-tokens
93
+ # https://huggingface.co/settings/tokens
94
+ # %pip install --upgrade --quiet langchain-huggingface text-generation transformers google-search-results numexpr langchainhub sentencepiece jinja2
95
+ # 1. Instantiate an LLM
96
+ # HuggingFaceEndpoint
97
+ # from langchain_huggingface import HuggingFaceEndpoint
98
+ #
99
+ llm = HuggingFaceEndpoint(
100
+ repo_id="meta-llama/Meta-Llama-3-70B-Instruct",
101
+ task="text-generation",
102
+ max_new_tokens=512,
103
+ do_sample=False,
104
+ repetition_penalty=1.03,
105
+ )
106
+
107
+ # API Reference:HuggingFaceEndpoint
108
+
109
+
110
  print("JB: in class NewsletterGenCrew - using llm: ", llm)
111
 
112
  return llm