Davit6174 commited on
Commit
91a6778
·
verified ·
1 Parent(s): 43440dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -20,6 +20,8 @@ from langchain_community.chat_models import ChatHuggingFace
20
  # --- Constants ---
21
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
22
 
 
 
23
  # --- Basic Agent Definition ---
24
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
25
  class BasicAgent:
@@ -37,7 +39,8 @@ class LangGraphAgent:
37
  self.model = ChatHuggingFace.from_model_id(
38
  model_id="HuggingFaceH4/zephyr-7b-beta",
39
  task="text-generation",
40
- model_kwargs={"temperature": 0.7, "max_new_tokens": 512}
 
41
  )
42
 
43
  # Define a simple graph with just one node
 
20
  # --- Constants ---
21
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
22
 
23
+ hf_token = os.getenv("HF_TOKEN")
24
+
25
  # --- Basic Agent Definition ---
26
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
27
  class BasicAgent:
 
39
  self.model = ChatHuggingFace.from_model_id(
40
  model_id="HuggingFaceH4/zephyr-7b-beta",
41
  task="text-generation",
42
+ model_kwargs={"temperature": 0.7, "max_new_tokens": 512},
43
+ huggingfacehub_api_token=hf_token
44
  )
45
 
46
  # Define a simple graph with just one node