Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,16 @@
|
|
1 |
import streamlit as st
|
2 |
from crewai import Agent, Task, Crew
|
3 |
-
from
|
|
|
4 |
import os
|
5 |
|
6 |
-
|
7 |
-
huggingfacehub_api_token = os.getenv('HUGGINGFACEHUB_API_TOKEN')
|
8 |
-
|
9 |
-
if not huggingfacehub_api_token:
|
10 |
-
raise ValueError("HUGGINGFACEHUB_API_TOKEN environment variable not set")
|
11 |
|
12 |
-
# Initialize HuggingFaceHub with the API token
|
13 |
llm = HuggingFaceHub(
|
14 |
repo_id="HuggingFaceH4/zephyr-7b-beta",
|
15 |
-
huggingfacehub_api_token=
|
16 |
task="text-generation",
|
17 |
)
|
18 |
-
|
19 |
# Define Agents
|
20 |
planner = Agent(
|
21 |
role="Content Planner",
|
@@ -130,4 +125,4 @@ def main():
|
|
130 |
st.error("Please enter a topic.")
|
131 |
|
132 |
if __name__ == "__main__":
|
133 |
-
main()
|
|
|
1 |
import streamlit as st
|
2 |
from crewai import Agent, Task, Crew
|
3 |
+
from langchain_google_genai import ChatGoogleGenerativeAI
|
4 |
+
from dotenv import load_dotenv
|
5 |
import os
|
6 |
|
7 |
+
from langchain_community.llms import HuggingFaceHub
|
|
|
|
|
|
|
|
|
8 |
|
|
|
9 |
llm = HuggingFaceHub(
|
10 |
repo_id="HuggingFaceH4/zephyr-7b-beta",
|
11 |
+
huggingfacehub_api_token= os.getenv('HF_API_KEY'),
|
12 |
task="text-generation",
|
13 |
)
|
|
|
14 |
# Define Agents
|
15 |
planner = Agent(
|
16 |
role="Content Planner",
|
|
|
125 |
st.error("Please enter a topic.")
|
126 |
|
127 |
if __name__ == "__main__":
|
128 |
+
main()
|