更新模型配置,切换至 ollama/qwen2:7b,并调整提示信息为中文

This commit is contained in:
严浩
2025-01-14 11:13:34 +08:00
parent 320df7e2a5
commit 864fe92669

View File

@ -3,13 +3,19 @@ from scrapegraphai.graphs import SmartScraperGraph
graph_config = { graph_config = {
"llm": { "llm": {
# "model": "ollama/mistral-nemo:latest", # "model": "ollama/mistral-nemo:latest",
"model": "ollama/mistral:latest", # "model": "ollama/mistral:latest",
# "model": "ollama/llama3.2:latest",
# "model_tokens": 131072, # ollama show llama3.2:latest
"model": "ollama/qwen2:7b",
"model_tokens": 32768, # ollama show qwen2:7b
"temperature": 0, # 更准确执行任务 "temperature": 0, # 更准确执行任务
"format": "json", # Ollama 需要显式指定格式 "format": "json", # Ollama 需要显式指定格式
}, },
"embeddings": { "embeddings": {
"model": "ollama/nomic-embed-text", "model": "ollama/nomic-embed-text",
}, },
"verbose": True, "verbose": True,
# "headless": False, # "headless": False,
@ -17,8 +23,8 @@ graph_config = {
# 抓取网页标题 # 抓取网页标题
smart_scraper_graph = SmartScraperGraph( smart_scraper_graph = SmartScraperGraph(
prompt="List all article titles on the page", # prompt="List all article titles on the page",
# prompt="列出页面上的所有文章标题", prompt="列出页面上的所有文章标题",
source="https://www.aivi.fyi/", source="https://www.aivi.fyi/",
config=graph_config config=graph_config
) )