Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
import os from getpass import getpass from agno.agent import Agent from agno.models.huggingface import HuggingFace agent = Agent( model=HuggingFace( id="meta-llama/Meta-Llama-3-8B-Instruct", max_tokens=4096, ), description="你是一位论文写作助手。请根据用户提供的主题撰写一篇 300 字的论文。", ) agent.print_response("topic: AI")
创建虚拟环境
Terminal
python3 -m venv .venv source .venv/bin/activate
设置您的 API 密钥
export HF_TOKEN=xxx
安装库
pip install -U huggingface_hub agno
运行 Agent
python cookbook/models/huggingface/llama_essay_writer.py