Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,8 @@ from langchain_community.tools import DuckDuckGoSearchRun
|
|
8 |
from langchain.agents import Tool, AgentExecutor, initialize_agent
|
9 |
from langchain.agents.agent_types import AgentType
|
10 |
from langchain.prompts.chat import SystemMessagePromptTemplate, ChatPromptTemplate, HumanMessagePromptTemplate
|
|
|
|
|
11 |
|
12 |
|
13 |
# (Keep Constants as is)
|
@@ -46,7 +48,14 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
46 |
|
47 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
48 |
try:
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
search = DuckDuckGoSearchRun()
|
52 |
tools = [
|
|
|
8 |
from langchain.agents import Tool, AgentExecutor, initialize_agent
|
9 |
from langchain.agents.agent_types import AgentType
|
10 |
from langchain.prompts.chat import SystemMessagePromptTemplate, ChatPromptTemplate, HumanMessagePromptTemplate
|
11 |
+
from langchain_huggingface import HuggingFaceEndpoint
|
12 |
+
|
13 |
|
14 |
|
15 |
# (Keep Constants as is)
|
|
|
48 |
|
49 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
50 |
try:
|
51 |
+
# llm = ChatOllama(model="llama3.1")
|
52 |
+
login(token=os.getenv('HF_TOKEN'))
|
53 |
+
|
54 |
+
# Use a Hugging Face cloud model
|
55 |
+
llm = HuggingFaceEndpoint(
|
56 |
+
repo_id="google/flan-t5-base", # Example cloud model; change as needed,
|
57 |
+
task="text-generation"
|
58 |
+
)
|
59 |
|
60 |
search = DuckDuckGoSearchRun()
|
61 |
tools = [
|