Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,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 |
|
@@ -52,7 +54,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
52 |
login(token=os.getenv('HF_TOKEN'))
|
53 |
|
54 |
# Use a Hugging Face cloud model
|
55 |
-
llm =
|
56 |
repo_id="google/flan-t5-base", # Example cloud model; change as needed,
|
57 |
task="text-generation"
|
58 |
)
|
|
|
9 |
from langchain.agents.agent_types import AgentType
|
10 |
from langchain.prompts.chat import SystemMessagePromptTemplate, ChatPromptTemplate, HumanMessagePromptTemplate
|
11 |
from langchain_huggingface import HuggingFaceEndpoint
|
12 |
+
from huggingface_hub import login
|
13 |
+
from langchain.llms import HuggingFaceHub
|
14 |
|
15 |
|
16 |
|
|
|
54 |
login(token=os.getenv('HF_TOKEN'))
|
55 |
|
56 |
# Use a Hugging Face cloud model
|
57 |
+
llm = HuggingFaceHub(
|
58 |
repo_id="google/flan-t5-base", # Example cloud model; change as needed,
|
59 |
task="text-generation"
|
60 |
)
|