Spaces:
Build error
Build error
Update agents.py
Browse files
agents.py
CHANGED
|
@@ -6,16 +6,21 @@ from tools.image_generation_tools import ImageGenerationTools
|
|
| 6 |
|
| 7 |
load_dotenv()
|
| 8 |
secret_token = os.getenv("content")
|
| 9 |
-
|
| 10 |
|
| 11 |
repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
|
| 12 |
mistral = HuggingFaceEndpoint(repo_id=repo_id, huggingfacehub_api_token=secret_token, max_new_tokens=28000, temperature=0.3, repetition_penalty=1.1)
|
| 13 |
-
|
| 14 |
-
from groq import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
class ContentAgents:
|
| 17 |
def __init__(self):
|
| 18 |
-
self.llm =
|
| 19 |
self.image_generator = ImageGenerationTools()
|
| 20 |
|
| 21 |
def generate_image_for_section(self, section_title, topic):
|
|
|
|
| 6 |
|
| 7 |
load_dotenv()
|
| 8 |
secret_token = os.getenv("content")
|
| 9 |
+
|
| 10 |
|
| 11 |
repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
|
| 12 |
mistral = HuggingFaceEndpoint(repo_id=repo_id, huggingfacehub_api_token=secret_token, max_new_tokens=28000, temperature=0.3, repetition_penalty=1.1)
|
| 13 |
+
|
| 14 |
+
from groq import Groq
|
| 15 |
+
|
| 16 |
+
client = Groq(
|
| 17 |
+
api_key=os.environ.get("groq_api_key"),
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
|
| 21 |
class ContentAgents:
|
| 22 |
def __init__(self):
|
| 23 |
+
self.llm = client(api_key=groq_api_key, model_name="llama3-8b-8192")
|
| 24 |
self.image_generator = ImageGenerationTools()
|
| 25 |
|
| 26 |
def generate_image_for_section(self, section_title, topic):
|