Spaces:
Runtime error
Runtime error
Prathamesh1420
commited on
Commit
•
af23c44
1
Parent(s):
baf2138
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,21 @@
|
|
1 |
import streamlit as st
|
2 |
from crewai import Agent, Task, Crew
|
3 |
-
from
|
4 |
-
from dotenv import load_dotenv
|
5 |
import os
|
6 |
|
7 |
-
from
|
|
|
8 |
|
|
|
|
|
|
|
|
|
9 |
llm = HuggingFaceHub(
|
10 |
repo_id="HuggingFaceH4/zephyr-7b-beta",
|
11 |
-
|
12 |
task="text-generation",
|
13 |
)
|
|
|
14 |
# Define Agents
|
15 |
planner = Agent(
|
16 |
role="Content Planner",
|
|
|
1 |
import streamlit as st
|
2 |
from crewai import Agent, Task, Crew
|
3 |
+
from langchain_community.llms import HuggingFaceHub
|
|
|
4 |
import os
|
5 |
|
6 |
+
# Retrieve the API token from environment variables
|
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=huggingfacehub_api_token,
|
16 |
task="text-generation",
|
17 |
)
|
18 |
+
|
19 |
# Define Agents
|
20 |
planner = Agent(
|
21 |
role="Content Planner",
|