Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,20 +29,22 @@ class BasicAgent: # Some times Inheritance is needed
|
|
| 29 |
def __init__(self):
|
| 30 |
print("BasicAgent with LangChain initialized.")
|
| 31 |
|
| 32 |
-
# Create the LLM # Temprature set to 0 because we need exact match
|
| 33 |
-
#llm = ChatOpenAI(temperature=0, model="gpt-3.5-turbo") # ChatML understands roles (user, assistant, system)
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
# model_kwargs={"temperature": 0.5, "max_new_tokens": 512}
|
| 38 |
-
# )
|
| 39 |
-
# Define the LLM
|
| 40 |
-
llm = HuggingFaceEndpoint(
|
| 41 |
-
endpoint_url="https://api-inference.huggingface.co/models/tiiuae/falcon-7b-instruct",
|
| 42 |
huggingfacehub_api_token=os.environ["HUGGINGFACEHUB_API_TOKEN"],
|
| 43 |
-
temperature
|
| 44 |
-
max_new_tokens=512
|
| 45 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
# Define tools # Description matters a lot, unless youre using @tool as a decorator and a python function (pulls docstring as tool description)
|
| 48 |
search = DuckDuckGoSearchRun()
|
|
|
|
| 29 |
def __init__(self):
|
| 30 |
print("BasicAgent with LangChain initialized.")
|
| 31 |
|
| 32 |
+
# # Create the LLM # Temprature set to 0 because we need exact match
|
| 33 |
+
# llm = ChatOpenAI(temperature=0, model="gpt-3.5-turbo") # ChatML understands roles (user, assistant, system)
|
| 34 |
+
|
| 35 |
+
llm = HuggingFaceHub(
|
| 36 |
+
repo_id="tiiuae/falcon-7b-instruct",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
huggingfacehub_api_token=os.environ["HUGGINGFACEHUB_API_TOKEN"],
|
| 38 |
+
model_kwargs={"temperature": 0.5, "max_new_tokens": 512}
|
|
|
|
| 39 |
)
|
| 40 |
+
|
| 41 |
+
# # Define the LLM
|
| 42 |
+
# llm = HuggingFaceEndpoint(
|
| 43 |
+
# endpoint_url="https://api-inference.huggingface.co/models/tiiuae/falcon-7b-instruct",
|
| 44 |
+
# huggingfacehub_api_token=os.environ["HUGGINGFACEHUB_API_TOKEN"],
|
| 45 |
+
# temperature=0.5,
|
| 46 |
+
# max_new_tokens=512
|
| 47 |
+
# )
|
| 48 |
|
| 49 |
# Define tools # Description matters a lot, unless youre using @tool as a decorator and a python function (pulls docstring as tool description)
|
| 50 |
search = DuckDuckGoSearchRun()
|