Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8066fc4386 | |||
| 9cd9ccd8e0 | |||
| a9cbd1b2ba | |||
| 685582b7e6 | |||
| 961322f8ba | |||
| b40e890e2b | |||
| 9525d56ffc | |||
| 5433605fec | |||
| b981e30f46 | |||
| e2d35b6fa0 | |||
| 45190980a9 | |||
| 627148a87f | |||
| 74be7688c9 | |||
| 7a2b1da9ff | |||
| dfd7234fd6 | |||
| 22b1a78132 | |||
| d28ad1a292 |
@@ -5,7 +5,54 @@
|
||||
"icon": "ri-robot-line",
|
||||
"color": "blue",
|
||||
"description": "大语言模型、图像模型等AI模型参数",
|
||||
"order": 1
|
||||
"order": 1,
|
||||
"subcategories": [
|
||||
{
|
||||
"id": "chat",
|
||||
"name": "对话模型",
|
||||
"icon": "ri-chat-3-line",
|
||||
"key_features": ["context_length", "mmlu", "input_price", "output_price"],
|
||||
"feature_labels": {
|
||||
"context_length": "上下文",
|
||||
"mmlu": "MMLU",
|
||||
"input_price": "输入价",
|
||||
"output_price": "输出价"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "code",
|
||||
"name": "代码模型",
|
||||
"icon": "ri-code-line",
|
||||
"key_features": ["humaneval", "context_length", "input_price"],
|
||||
"feature_labels": {
|
||||
"humaneval": "HumanEval",
|
||||
"context_length": "上下文",
|
||||
"input_price": "输入价"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "reasoning",
|
||||
"name": "推理模型",
|
||||
"icon": "ri-lightbulb-line",
|
||||
"key_features": ["reasoning_capability", "mmlu", "context_length"],
|
||||
"feature_labels": {
|
||||
"reasoning_capability": "推理能力",
|
||||
"mmlu": "MMLU",
|
||||
"context_length": "上下文"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "vision",
|
||||
"name": "视觉模型",
|
||||
"icon": "ri-image-line",
|
||||
"key_features": ["vision_capability", "multimodal", "context_length"],
|
||||
"feature_labels": {
|
||||
"vision_capability": "视觉能力",
|
||||
"multimodal": "多模态",
|
||||
"context_length": "上下文"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "gpus",
|
||||
@@ -13,15 +60,91 @@
|
||||
"icon": "ri-cpu-line",
|
||||
"color": "green",
|
||||
"description": "NVIDIA、AMD等GPU显卡规格参数",
|
||||
"order": 2
|
||||
"order": 2,
|
||||
"subcategories": [
|
||||
{
|
||||
"id": "gaming",
|
||||
"name": "游戏显卡",
|
||||
"icon": "ri-gamepad-line",
|
||||
"key_features": ["memory_gb", "cuda_cores", "price_usd", "fp16_tflops"],
|
||||
"feature_labels": {
|
||||
"memory_gb": "显存",
|
||||
"cuda_cores": "CUDA核心",
|
||||
"price_usd": "价格",
|
||||
"fp16_tflops": "FP16性能"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "professional",
|
||||
"name": "专业显卡",
|
||||
"icon": "ri-building-line",
|
||||
"key_features": ["memory_gb", "tensor_cores", "memory_bandwidth_gbs", "price_usd"],
|
||||
"feature_labels": {
|
||||
"memory_gb": "显存",
|
||||
"tensor_cores": "Tensor核心",
|
||||
"memory_bandwidth_gbs": "带宽",
|
||||
"price_usd": "价格"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "datacenter",
|
||||
"name": "数据中心",
|
||||
"icon": "ri-server-line",
|
||||
"key_features": ["memory_gb", "tensor_cores", "memory_bandwidth_gbs", "fp16_tflops"],
|
||||
"feature_labels": {
|
||||
"memory_gb": "显存",
|
||||
"tensor_cores": "Tensor核心",
|
||||
"memory_bandwidth_gbs": "带宽",
|
||||
"fp16_tflops": "FP16性能"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cpus",
|
||||
"name": "CPU处理器",
|
||||
"icon": "ri-memory-line",
|
||||
"icon": "ri-cpu-line",
|
||||
"color": "purple",
|
||||
"description": "Intel、AMD等CPU处理器参数",
|
||||
"order": 3
|
||||
"order": 3,
|
||||
"subcategories": [
|
||||
{
|
||||
"id": "desktop",
|
||||
"name": "桌面CPU",
|
||||
"icon": "ri-computer-line",
|
||||
"key_features": ["cores", "threads", "boost_clock_ghz", "price_usd"],
|
||||
"feature_labels": {
|
||||
"cores": "核心",
|
||||
"threads": "线程",
|
||||
"boost_clock_ghz": "加速频率",
|
||||
"price_usd": "价格"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "server",
|
||||
"name": "服务器CPU",
|
||||
"icon": "ri-server-line",
|
||||
"key_features": ["cores", "threads", "l3_cache_mb", "tdp_watts"],
|
||||
"feature_labels": {
|
||||
"cores": "核心",
|
||||
"threads": "线程",
|
||||
"l3_cache_mb": "L3缓存",
|
||||
"tdp_watts": "功耗"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "mobile",
|
||||
"name": "移动CPU",
|
||||
"icon": "ri-smartphone-line",
|
||||
"key_features": ["cores", "threads", "base_clock_ghz", "tdp_watts"],
|
||||
"feature_labels": {
|
||||
"cores": "核心",
|
||||
"threads": "线程",
|
||||
"base_clock_ghz": "基础频率",
|
||||
"tdp_watts": "功耗"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "phones",
|
||||
@@ -29,7 +152,34 @@
|
||||
"icon": "ri-smartphone-line",
|
||||
"color": "orange",
|
||||
"description": "各品牌手机参数规格",
|
||||
"order": 4
|
||||
"order": 4,
|
||||
"visible": true,
|
||||
"subcategories": [
|
||||
{
|
||||
"id": "flagship",
|
||||
"name": "旗舰手机",
|
||||
"icon": "ri-star-line",
|
||||
"key_features": ["processor", "ram_gb", "storage_gb", "price"],
|
||||
"feature_labels": {
|
||||
"processor": "处理器",
|
||||
"ram_gb": "内存",
|
||||
"storage_gb": "存储",
|
||||
"price": "价格"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "midrange",
|
||||
"name": "中端手机",
|
||||
"icon": "ri-price-tag-3-line",
|
||||
"key_features": ["processor", "ram_gb", "battery_mah", "price"],
|
||||
"feature_labels": {
|
||||
"processor": "处理器",
|
||||
"ram_gb": "内存",
|
||||
"battery_mah": "电池",
|
||||
"price": "价格"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "laptops",
|
||||
@@ -37,15 +187,101 @@
|
||||
"icon": "ri-macbook-line",
|
||||
"color": "teal",
|
||||
"description": "笔记本电脑、台式机参数",
|
||||
"order": 5
|
||||
"order": 5,
|
||||
"subcategories": [
|
||||
{
|
||||
"id": "gaming-laptop",
|
||||
"name": "游戏笔记本",
|
||||
"icon": "ri-gamepad-line",
|
||||
"key_features": ["processor", "gpu", "ram_gb", "price"],
|
||||
"feature_labels": {
|
||||
"processor": "处理器",
|
||||
"gpu": "显卡",
|
||||
"ram_gb": "内存",
|
||||
"price": "价格"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "business-laptop",
|
||||
"name": "商务笔记本",
|
||||
"icon": "ri-briefcase-line",
|
||||
"key_features": ["processor", "ram_gb", "weight_kg", "price"],
|
||||
"feature_labels": {
|
||||
"processor": "处理器",
|
||||
"ram_gb": "内存",
|
||||
"weight_kg": "重量",
|
||||
"price": "价格"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "021dc76d36be",
|
||||
"name": "汽车",
|
||||
"icon": "ri-folder-line",
|
||||
"color": "blue",
|
||||
"icon": "ri-car-line",
|
||||
"color": "red",
|
||||
"order": 6,
|
||||
"description": "汽车方面",
|
||||
"created_at": "2026-04-09 10:09:01"
|
||||
"created_at": "2026-04-09 10:09:01",
|
||||
"subcategories": [
|
||||
{
|
||||
"id": "sedan",
|
||||
"name": "轿车",
|
||||
"icon": "ri-car-line",
|
||||
"key_features": ["engine", "power_kw", "price"],
|
||||
"feature_labels": {
|
||||
"engine": "发动机",
|
||||
"power_kw": "功率",
|
||||
"price": "价格"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "suv",
|
||||
"name": "SUV",
|
||||
"icon": "ri-truck-line",
|
||||
"key_features": ["engine", "seats", "price"],
|
||||
"feature_labels": {
|
||||
"engine": "发动机",
|
||||
"seats": "座位数",
|
||||
"price": "价格"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "71fa2b4d818f",
|
||||
"name": "摄像",
|
||||
"icon": "ri-camera-line",
|
||||
"color": "blue",
|
||||
"order": 0,
|
||||
"visible": true,
|
||||
"description": "相机、摄像机等",
|
||||
"created_at": "2026-04-25 16:38:47",
|
||||
"subcategories": [
|
||||
{
|
||||
"id": "mirrorless",
|
||||
"name": "无反相机",
|
||||
"icon": "ri-camera-line",
|
||||
"key_features": ["sensor", "megapixels", "video_resolution", "price"],
|
||||
"feature_labels": {
|
||||
"sensor": "传感器",
|
||||
"megapixels": "像素",
|
||||
"video_resolution": "视频",
|
||||
"price": "价格"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "dslr",
|
||||
"name": "单反相机",
|
||||
"icon": "ri-camera-2-line",
|
||||
"key_features": ["sensor", "megapixels", "lens_mount", "price"],
|
||||
"feature_labels": {
|
||||
"sensor": "传感器",
|
||||
"megapixels": "像素",
|
||||
"lens_mount": "卡口",
|
||||
"price": "价格"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
14
data/config.json
Normal file
14
data/config.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"site_name": "ParamHub",
|
||||
"site_subtitle": "参数百科",
|
||||
"footer_text": "ParamHub - 模型与硬件参数速查平台",
|
||||
"icp_number": "",
|
||||
"copyright_year": "2026",
|
||||
"contact_email": "wlq@tphai.com",
|
||||
"github_url": "",
|
||||
"updated_at": "2026-04-27 19:57:00",
|
||||
"llm_base_url": "http://192.168.2.17:19007/v1",
|
||||
"llm_api_key": "",
|
||||
"llm_model": "auto",
|
||||
"llm_vision_model": "gpt-4-vision-preview"
|
||||
}
|
||||
@@ -7,5 +7,28 @@
|
||||
"category_id": "021dc76d36be",
|
||||
"id": "3d20dbcd4bdd",
|
||||
"created_at": "2026-04-09 10:09:56"
|
||||
},
|
||||
{
|
||||
"name": "秦PLUS",
|
||||
"brand": "比亚迪",
|
||||
"price": 5.98,
|
||||
"specs": {
|
||||
"长宽高": "4780*1837*1515mm",
|
||||
"轴距": "2718mm",
|
||||
"前轮距": "1580mm",
|
||||
"后轮距": "1590mm",
|
||||
"轮胎规格": "225/60 R16",
|
||||
"发动机": "1.5L 101马力 L4",
|
||||
"最大功率": "74kW",
|
||||
"最大扭矩": "126N·m",
|
||||
"变速器": "E-CVT无级变速器",
|
||||
"中控屏幕尺寸": "10.1英寸"
|
||||
},
|
||||
"description": "秦PLUS是一款外观设计极具现代感和运动气息的车型,采用家族化设计语言,配备大尺寸进气格栅和锐利LED大灯。车身线条流畅,内饰简洁大气,配备10.1英寸中控屏和语音识别系统。搭载1.5L发动机和E-CVT变速器,提供平稳动力输出和低油耗。内部空间宽敞,座椅舒适,支持多种调节功能。",
|
||||
"id": "b78fc7983a70",
|
||||
"category_id": "021dc76d36be",
|
||||
"created_at": "2026-04-11 02:03:45",
|
||||
"visible": true,
|
||||
"raw_text": "秦PLUS的外观设计极具现代感和运动气息,前脸采用了家族化设计语言,标志性的大尺寸进气格栅占据了前脸的大部分空间,搭配锐利的LED大灯组,营造出强烈的视觉冲击力。车身线条流畅,腰线从车头贯穿至车尾,增强了整车的运动感。车尾部分,简洁大方的设计与前脸相呼应,整体风格时尚而不失稳重。\n\n上海:秦PLUS优惠促销,最新报价5.98万!轻松开新车\n\n秦PLUS拥有4780*1837*1515mm的长宽高尺寸和2718mm的轴距,赋予其宽敞的内部空间。车侧线条流畅且动感十足,从前轮距1580mm到后轮距1590mm,车轮布局合理,增强了车辆的稳定性和操控性。配备的225/60 R16轮胎规格,匹配独特风格的轮圈,为车辆增添了一抹动感与时尚的气息。\n\n上海:秦PLUS优惠促销,最新报价5.98万!轻松开新车\n\n秦PLUS的内饰风格简洁大气,给人以科技感和舒适感。中控台布局合理,配备了10.1英寸的中控屏幕,支持语音识别控制系统,可轻松操作多媒体系统、导航、电话和空调等功能。方向盘采用皮质材料,手感舒适,支持手动上下和前后调节,方便驾驶员调整到最佳驾驶姿势。座椅采用仿皮材质,主驾驶座椅具备前后调节、靠背调节和高低调节功能,而副驾驶座椅则支持前后调节和靠背调节,确保了乘客的舒适度。后排座椅可以按比例放倒,增加储物空间,同时,车内还配备了USB和Type-C接口,方便乘客为电子设备充电。\n\n上海:秦PLUS优惠促销,最新报价5.98万!轻松开新车\n\n秦PLUS搭载了一台1.5L 101马力的L4发动机,最大功率为74kW,最大扭矩为126N·m。与之匹配的是E-CVT无级变速器,这使得车辆在提供平稳的动力输出的同时,还能有效降低油耗。\n\n汽车之家车主@天艺风云 表示,外观设计是他当初选择秦PLUS的原因之一。他赞赏整体造型时尚大气,龙脸设计搭配犀利的大灯,辨识度极高。车身线条流畅,溜背式造型增添了几分运动感。全新的“龙鳞辉熠”格栅,精致又霸气,每次停车都有人问这是什么车,外观确实很吸引人。"
|
||||
}
|
||||
]
|
||||
205
data/models.json
205
data/models.json
@@ -1,14 +1,195 @@
|
||||
[
|
||||
{"id": "gpt4", "name": "GPT-4", "organization": "OpenAI", "parameters": 1760, "architecture": "Transformer", "context_length": 8192, "input_price": 0.03, "output_price": 0.06, "mmlu": 86.4, "humaneval": 67.0, "is_open_source": false, "license": "Proprietary", "description": "OpenAI最强大的多模态大模型", "created_at": "2024-01-01"},
|
||||
{"id": "gpt4turbo", "name": "GPT-4 Turbo", "organization": "OpenAI", "parameters": 1760, "architecture": "Transformer", "context_length": 128000, "input_price": 0.01, "output_price": 0.03, "mmlu": 86.4, "humaneval": 67.0, "is_open_source": false, "license": "Proprietary", "description": "GPT-4增强版,128K上下文", "created_at": "2024-01-01"},
|
||||
{"id": "gpt35", "name": "GPT-3.5 Turbo", "organization": "OpenAI", "parameters": 175, "architecture": "Transformer", "context_length": 16385, "input_price": 0.0005, "output_price": 0.0015, "mmlu": 70.0, "humaneval": 48.1, "is_open_source": false, "license": "Proprietary", "description": "性价比高的通用模型", "created_at": "2024-01-01"},
|
||||
{"id": "claude3opus", "name": "Claude 3 Opus", "organization": "Anthropic", "parameters": 400, "architecture": "Transformer", "context_length": 200000, "input_price": 0.015, "output_price": 0.075, "mmlu": 86.8, "humaneval": 84.9, "is_open_source": false, "license": "Proprietary", "description": "Anthropic最强模型,200K上下文", "created_at": "2024-01-01"},
|
||||
{"id": "claude3sonnet", "name": "Claude 3 Sonnet", "organization": "Anthropic", "parameters": 175, "architecture": "Transformer", "context_length": 200000, "input_price": 0.003, "output_price": 0.015, "mmlu": 79.0, "humaneval": 73.0, "is_open_source": false, "license": "Proprietary", "description": "平衡性能与成本", "created_at": "2024-01-01"},
|
||||
{"id": "llama270b", "name": "Llama 2 70B", "organization": "Meta", "parameters": 70, "architecture": "Transformer", "context_length": 4096, "input_price": 0, "output_price": 0, "mmlu": 69.8, "humaneval": 29.9, "is_open_source": true, "license": "Llama 2 Community", "description": "Meta开源大模型,70B参数", "created_at": "2024-01-01"},
|
||||
{"id": "llama3", "name": "Llama 3 70B", "organization": "Meta", "parameters": 70, "architecture": "Transformer", "context_length": 8192, "input_price": 0, "output_price": 0, "mmlu": 82.0, "humaneval": 81.7, "is_open_source": true, "license": "Llama 3 Community", "description": "Meta最新开源模型,性能接近GPT-4", "created_at": "2024-01-01"},
|
||||
{"id": "mistral7b", "name": "Mistral 7B", "organization": "Mistral AI", "parameters": 7, "architecture": "Transformer", "context_length": 32768, "input_price": 0, "output_price": 0, "mmlu": 62.5, "humaneval": 26.8, "is_open_source": true, "license": "Apache 2.0", "description": "小巧高效的开源模型", "created_at": "2024-01-01"},
|
||||
{"id": "mixtral8x7b", "name": "Mixtral 8x7B", "organization": "Mistral AI", "parameters": 47, "architecture": "MoE", "context_length": 32768, "input_price": 0, "output_price": 0, "mmlu": 70.6, "humaneval": 40.2, "is_open_source": true, "license": "Apache 2.0", "description": "MoE架构,高效推理", "created_at": "2024-01-01"},
|
||||
{"id": "qwen72b", "name": "Qwen 72B", "organization": "Alibaba", "parameters": 72, "architecture": "Transformer", "context_length": 32768, "input_price": 0, "output_price": 0, "mmlu": 83.1, "humaneval": 65.4, "is_open_source": true, "license": "Apache 2.0", "description": "阿里开源大模型,中文能力强", "created_at": "2024-01-01"},
|
||||
{"id": "deepseekv3", "name": "DeepSeek V3", "organization": "DeepSeek", "parameters": 685, "architecture": "MoE", "context_length": 128000, "input_price": 0.00014, "output_price": 0.00028, "mmlu": 88.5, "humaneval": 86.2, "is_open_source": true, "license": "MIT", "description": "DeepSeek最新模型,性价比极高", "created_at": "2024-01-01"},
|
||||
{"id": "glm4", "name": "GLM-4", "organization": "Zhipu AI", "parameters": 130, "architecture": "Transformer", "context_length": 128000, "input_price": 0.014, "output_price": 0.014, "mmlu": 81.0, "humaneval": 70.0, "is_open_source": false, "license": "Proprietary", "description": "智谱AI大模型,中文能力强", "created_at": "2024-01-01"}
|
||||
{
|
||||
"id": "gpt4",
|
||||
"name": "GPT-4",
|
||||
"organization": "OpenAI",
|
||||
"parameters": 1760,
|
||||
"architecture": "Transformer",
|
||||
"context_length": 8192,
|
||||
"input_price": 0.03,
|
||||
"output_price": 0.06,
|
||||
"mmlu": 86.4,
|
||||
"humaneval": 67.0,
|
||||
"is_open_source": false,
|
||||
"license": "Proprietary",
|
||||
"description": "OpenAI最强大的多模态大模型",
|
||||
"created_at": "2024-01-01"
|
||||
},
|
||||
{
|
||||
"id": "gpt4turbo",
|
||||
"name": "GPT-4 Turbo",
|
||||
"organization": "OpenAI",
|
||||
"parameters": 1760,
|
||||
"architecture": "Transformer",
|
||||
"context_length": 128000,
|
||||
"input_price": 0.01,
|
||||
"output_price": 0.03,
|
||||
"mmlu": 86.4,
|
||||
"humaneval": 67.0,
|
||||
"is_open_source": false,
|
||||
"license": "Proprietary",
|
||||
"description": "GPT-4增强版,128K上下文",
|
||||
"created_at": "2024-01-01"
|
||||
},
|
||||
{
|
||||
"id": "gpt35",
|
||||
"name": "GPT-3.5 Turbo",
|
||||
"organization": "OpenAI",
|
||||
"parameters": 175,
|
||||
"architecture": "Transformer",
|
||||
"context_length": 16385,
|
||||
"input_price": 0.0005,
|
||||
"output_price": 0.0015,
|
||||
"mmlu": 70.0,
|
||||
"humaneval": 48.1,
|
||||
"is_open_source": false,
|
||||
"license": "Proprietary",
|
||||
"description": "性价比高的通用模型",
|
||||
"created_at": "2024-01-01"
|
||||
},
|
||||
{
|
||||
"id": "claude3opus",
|
||||
"name": "Claude 3 Opus",
|
||||
"organization": "Anthropic",
|
||||
"parameters": 400,
|
||||
"architecture": "Transformer",
|
||||
"context_length": 200000,
|
||||
"input_price": 0.015,
|
||||
"output_price": 0.075,
|
||||
"mmlu": 86.8,
|
||||
"humaneval": 84.9,
|
||||
"is_open_source": false,
|
||||
"license": "Proprietary",
|
||||
"description": "Anthropic最强模型,200K上下文",
|
||||
"created_at": "2024-01-01"
|
||||
},
|
||||
{
|
||||
"id": "claude3sonnet",
|
||||
"name": "Claude 3 Sonnet",
|
||||
"organization": "Anthropic",
|
||||
"parameters": 175,
|
||||
"architecture": "Transformer",
|
||||
"context_length": 200000,
|
||||
"input_price": 0.003,
|
||||
"output_price": 0.015,
|
||||
"mmlu": 79.0,
|
||||
"humaneval": 73.0,
|
||||
"is_open_source": false,
|
||||
"license": "Proprietary",
|
||||
"description": "平衡性能与成本",
|
||||
"created_at": "2024-01-01"
|
||||
},
|
||||
{
|
||||
"id": "llama270b",
|
||||
"name": "Llama 2 70B",
|
||||
"organization": "Meta",
|
||||
"parameters": 70,
|
||||
"architecture": "Transformer",
|
||||
"context_length": 4096,
|
||||
"input_price": 0,
|
||||
"output_price": 0,
|
||||
"mmlu": 69.8,
|
||||
"humaneval": 29.9,
|
||||
"is_open_source": true,
|
||||
"license": "Llama 2 Community",
|
||||
"description": "Meta开源大模型,70B参数",
|
||||
"created_at": "2024-01-01"
|
||||
},
|
||||
{
|
||||
"id": "llama3",
|
||||
"name": "Llama 3 70B",
|
||||
"organization": "Meta",
|
||||
"parameters": 70,
|
||||
"architecture": "Transformer",
|
||||
"context_length": 8192,
|
||||
"input_price": 0,
|
||||
"output_price": 0,
|
||||
"mmlu": 82.0,
|
||||
"humaneval": 81.7,
|
||||
"is_open_source": true,
|
||||
"license": "Llama 3 Community",
|
||||
"description": "Meta最新开源模型,性能接近GPT-4",
|
||||
"created_at": "2024-01-01"
|
||||
},
|
||||
{
|
||||
"id": "mistral7b",
|
||||
"name": "Mistral 7B",
|
||||
"organization": "Mistral AI",
|
||||
"parameters": 7,
|
||||
"architecture": "Transformer",
|
||||
"context_length": 32768,
|
||||
"input_price": 0,
|
||||
"output_price": 0,
|
||||
"mmlu": 62.5,
|
||||
"humaneval": 26.8,
|
||||
"is_open_source": true,
|
||||
"license": "Apache 2.0",
|
||||
"description": "小巧高效的开源模型",
|
||||
"created_at": "2024-01-01"
|
||||
},
|
||||
{
|
||||
"id": "mixtral8x7b",
|
||||
"name": "Mixtral 8x7B",
|
||||
"organization": "Mistral AI",
|
||||
"parameters": 47,
|
||||
"architecture": "MoE",
|
||||
"context_length": 32768,
|
||||
"input_price": 0,
|
||||
"output_price": 0,
|
||||
"mmlu": 70.6,
|
||||
"humaneval": 40.2,
|
||||
"is_open_source": true,
|
||||
"license": "Apache 2.0",
|
||||
"description": "MoE架构,高效推理",
|
||||
"created_at": "2024-01-01"
|
||||
},
|
||||
{
|
||||
"id": "qwen72b",
|
||||
"name": "Qwen 72B",
|
||||
"organization": "Alibaba",
|
||||
"parameters": 72,
|
||||
"architecture": "Transformer",
|
||||
"context_length": 32768,
|
||||
"input_price": 0,
|
||||
"output_price": 0,
|
||||
"mmlu": 83.1,
|
||||
"humaneval": 65.4,
|
||||
"is_open_source": true,
|
||||
"license": "Apache 2.0",
|
||||
"description": "阿里开源大模型,中文能力强",
|
||||
"created_at": "2024-01-01"
|
||||
},
|
||||
{
|
||||
"id": "deepseekv3",
|
||||
"name": "DeepSeek V3",
|
||||
"organization": "DeepSeek",
|
||||
"parameters": 685,
|
||||
"architecture": "MoE",
|
||||
"context_length": 128000,
|
||||
"input_price": 0.00014,
|
||||
"output_price": 0.00028,
|
||||
"mmlu": 88.5,
|
||||
"humaneval": 86.2,
|
||||
"is_open_source": true,
|
||||
"license": "MIT",
|
||||
"description": "DeepSeek最新模型,性价比极高",
|
||||
"created_at": "2024-01-01"
|
||||
},
|
||||
{
|
||||
"id": "glm4",
|
||||
"name": "GLM-4",
|
||||
"organization": "Zhipu AI",
|
||||
"parameters": 130,
|
||||
"architecture": "Transformer",
|
||||
"context_length": 128000,
|
||||
"input_price": 0.014,
|
||||
"output_price": 0.014,
|
||||
"mmlu": 81.0,
|
||||
"humaneval": 70.0,
|
||||
"is_open_source": false,
|
||||
"license": "Proprietary",
|
||||
"description": "智谱AI大模型,中文能力强",
|
||||
"created_at": "2024-01-01",
|
||||
"visible": true
|
||||
}
|
||||
]
|
||||
14
static/favicon.svg
Normal file
14
static/favicon.svg
Normal file
@@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
||||
<!-- 背景 -->
|
||||
<rect x="2" y="2" width="28" height="28" rx="6" fill="#4f46e5"/>
|
||||
<!-- 数据网格 -->
|
||||
<rect x="6" y="6" width="8" height="8" rx="2" fill="white"/>
|
||||
<rect x="18" y="6" width="8" height="8" rx="2" fill="white"/>
|
||||
<rect x="6" y="18" width="8" height="8" rx="2" fill="white"/>
|
||||
<rect x="18" y="18" width="8" height="8" rx="2" fill="white"/>
|
||||
<!-- 连接线 -->
|
||||
<line x1="14" y1="10" x2="18" y2="10" stroke="#4f46e5" stroke-width="2"/>
|
||||
<line x1="10" y1="14" x2="10" y2="18" stroke="#4f46e5" stroke-width="2"/>
|
||||
<line x1="22" y1="14" x2="22" y2="18" stroke="#4f46e5" stroke-width="2"/>
|
||||
<line x1="14" y1="22" x2="18" y2="22" stroke="#4f46e5" stroke-width="2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 757 B |
1181
templates/admin.html
1181
templates/admin.html
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ category.name }} - ParamHub</title>
|
||||
<title>ParamHub - 参数百科</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||
</head>
|
||||
@@ -50,9 +51,16 @@
|
||||
class="w-full pl-12 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:border-indigo-400"
|
||||
onkeyup="filterItems()">
|
||||
</div>
|
||||
<select id="sortSelect" onchange="sortItems()" class="px-4 py-2 border border-gray-200 rounded-lg focus:outline-none">
|
||||
<select id="sortBy" onchange="loadItems()" class="px-4 py-2 border border-gray-200 rounded-lg focus:outline-none">
|
||||
<option value="default">默认排序(置顶优先)</option>
|
||||
<option value="publish_date">按发布日期</option>
|
||||
<option value="views">按热度</option>
|
||||
<option value="name">按名称</option>
|
||||
<option value="created_at">按时间</option>
|
||||
<option value="created_at">按创建时间</option>
|
||||
</select>
|
||||
<select id="sortOrder" onchange="loadItems()" class="px-4 py-2 border border-gray-200 rounded-lg focus:outline-none">
|
||||
<option value="desc">降序</option>
|
||||
<option value="asc">升序</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -115,7 +123,9 @@
|
||||
|
||||
// 加载数据
|
||||
async function loadItems() {
|
||||
const res = await fetch(`/api/items/${categoryId}`);
|
||||
const sortBy = document.getElementById('sortBy').value;
|
||||
const sortOrder = document.getElementById('sortOrder').value;
|
||||
const res = await fetch(`/api/items/${categoryId}?sort=${sortBy}&order=${sortOrder}`);
|
||||
allItems = await res.json();
|
||||
|
||||
document.getElementById('itemCount').textContent = allItems.length;
|
||||
@@ -136,22 +146,28 @@
|
||||
|
||||
document.getElementById('itemsList').innerHTML = items.map(item => {
|
||||
const fields = Object.entries(item)
|
||||
.filter(([key, val]) => !['id', 'category_id', 'created_at', 'updated_at'].includes(key) && val)
|
||||
.filter(([key, val]) => !['id', 'category_id', 'created_at', 'updated_at', 'visible', 'is_pinned', 'views', 'publish_date'].includes(key) && val)
|
||||
.slice(0, 5)
|
||||
.map(([key, val]) => `<span class="text-gray-500 text-sm">${key}: ${val}</span>`)
|
||||
.join('<br>');
|
||||
|
||||
return `
|
||||
<div class="border border-gray-200 rounded-lg p-4 hover:shadow-md transition group">
|
||||
<div class="border border-gray-200 rounded-lg p-4 hover:shadow-md transition group ${item.is_pinned ? 'bg-yellow-50 border-yellow-300' : ''}">
|
||||
<div class="flex items-start justify-between">
|
||||
<div>
|
||||
<h3 class="font-medium text-gray-800 group-hover:text-indigo-600">${item.name || item.title || '未命名'}</h3>
|
||||
<h3 class="font-medium text-gray-800 group-hover:text-indigo-600 flex items-center gap-2">
|
||||
${item.is_pinned ? '<i class="ri-pushpin-fill text-yellow-500" title="置顶"></i>' : ''}
|
||||
${item.name || item.title || '未命名'}
|
||||
</h3>
|
||||
<div class="mt-2 space-y-1">
|
||||
${fields}
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-xs text-gray-400">
|
||||
${item.created_at ? item.created_at.split(' ')[0] : ''}
|
||||
<div class="text-right">
|
||||
<div class="text-xs text-gray-400">
|
||||
${item.publish_date || (item.created_at ? item.created_at.split(' ')[0] : '')}
|
||||
</div>
|
||||
${item.views ? `<div class="text-xs text-gray-400 mt-1"><i class="ri-eye-line"></i> ${item.views}</div>` : ''}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -175,19 +191,6 @@
|
||||
renderItems(filtered);
|
||||
}
|
||||
|
||||
// 排序
|
||||
function sortItems() {
|
||||
const sortBy = document.getElementById('sortSelect').value;
|
||||
const sorted = [...allItems].sort((a, b) => {
|
||||
if (sortBy === 'name') {
|
||||
return (a.name || a.title || '').localeCompare(b.name || b.title || '');
|
||||
} else {
|
||||
return (b.created_at || '').localeCompare(a.created_at || '');
|
||||
}
|
||||
});
|
||||
renderItems(sorted);
|
||||
}
|
||||
|
||||
// 初始化
|
||||
loadNav();
|
||||
loadItems();
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>对比工具 - ParamHub</title>
|
||||
<title>ParamHub - 参数百科</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||
</head>
|
||||
@@ -40,7 +41,7 @@
|
||||
<i class="ri-cpu-line mr-2"></i>GPU对比
|
||||
</button>
|
||||
<button onclick="setCompareType('cpu')" id="btnCpu" class="px-4 py-2 bg-gray-200 text-gray-600 rounded-lg hover:bg-gray-300">
|
||||
<i class="ri-memory-line mr-2"></i>CPU对比
|
||||
<i class="ri-cpu-line mr-2"></i>CPU对比
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>CPU数据库 - ParamHub</title>
|
||||
<title>ParamHub - 参数百科</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||
</head>
|
||||
@@ -24,7 +25,7 @@
|
||||
<main class="max-w-7xl mx-auto px-4 py-8">
|
||||
<div class="mb-6">
|
||||
<h1 class="text-2xl font-bold text-gray-800 flex items-center gap-2">
|
||||
<i class="ri-memory-line text-purple-600"></i>
|
||||
<i class="ri-cpu-line text-purple-600"></i>
|
||||
CPU数据库
|
||||
</h1>
|
||||
<p class="text-gray-500 mt-1">处理器规格参数一览</p>
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>GPU数据库 - ParamHub</title>
|
||||
<title>ParamHub - 参数百科</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>ParamHub - 参数百科</title>
|
||||
<title id="pageTitle">ParamHub - 参数百科</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||
</head>
|
||||
@@ -13,8 +14,8 @@
|
||||
<div class="max-w-7xl mx-auto px-4 py-3 flex justify-between items-center">
|
||||
<div class="flex items-center gap-2">
|
||||
<i class="ri-dashboard-3-line text-2xl text-indigo-600"></i>
|
||||
<span class="text-xl font-bold text-gray-800">ParamHub</span>
|
||||
<span class="text-sm text-gray-500">参数百科</span>
|
||||
<span class="text-xl font-bold text-gray-800" id="navSiteName">ParamHub</span>
|
||||
<span class="text-sm text-gray-500" id="navSiteSubtitle">参数百科</span>
|
||||
</div>
|
||||
<div class="flex gap-4 text-sm" id="navLinks">
|
||||
<!-- 动态加载 -->
|
||||
@@ -58,7 +59,7 @@
|
||||
<!-- 热门模型 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6">
|
||||
<h2 class="text-lg font-semibold text-gray-800 mb-4 flex items-center gap-2">
|
||||
<i class="ri-flashlight-line text-indigo-600"></i>
|
||||
<i class="ri-cpu-line text-indigo-600"></i>
|
||||
热门模型
|
||||
</h2>
|
||||
<div id="latestModels" class="grid grid-cols-2 gap-4">
|
||||
@@ -69,7 +70,7 @@
|
||||
|
||||
<!-- 页脚 -->
|
||||
<footer class="bg-white border-t mt-8 py-6 text-center text-gray-500 text-sm">
|
||||
ParamHub - 参数百科 | AI模型与硬件参数速查平台
|
||||
<span id="footerText">ParamHub - 参数百科 | AI模型与硬件参数速查平台</span>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
@@ -120,13 +121,32 @@
|
||||
|
||||
// 加载分类和数据统计
|
||||
async function loadData() {
|
||||
// 并行加载分类和统计
|
||||
const [catRes, statsRes] = await Promise.all([
|
||||
// 并行加载分类、统计、配置
|
||||
const [catRes, statsRes, configRes] = await Promise.all([
|
||||
fetch('/api/categories'),
|
||||
fetch('/api/stats')
|
||||
fetch('/api/stats'),
|
||||
fetch('/api/config')
|
||||
]);
|
||||
categories = await catRes.json();
|
||||
const stats = await statsRes.json();
|
||||
const config = await configRes.json();
|
||||
|
||||
// 更新网站名称等
|
||||
if (config.site_name) {
|
||||
document.getElementById('navSiteName').textContent = config.site_name;
|
||||
}
|
||||
if (config.site_subtitle) {
|
||||
document.getElementById('navSiteSubtitle').textContent = config.site_subtitle;
|
||||
}
|
||||
if (config.site_name && config.site_subtitle) {
|
||||
document.getElementById('pageTitle').textContent = `${config.site_name} - ${config.site_subtitle}`;
|
||||
}
|
||||
if (config.footer_text) {
|
||||
document.getElementById('footerText').textContent = config.footer_text;
|
||||
}
|
||||
if (config.icp_number) {
|
||||
document.getElementById('footerText').innerHTML += ` | <a href="https://beian.miit.gov.cn/" target="_blank" class="hover:text-gray-700">${config.icp_number}</a>`;
|
||||
}
|
||||
|
||||
// 渲染导航栏
|
||||
renderNavBar();
|
||||
@@ -146,7 +166,7 @@
|
||||
const statItems = [
|
||||
{key: 'models_count', label: 'AI模型', icon: 'ri-robot-line', color: 'blue'},
|
||||
{key: 'gpus_count', label: 'GPU显卡', icon: 'ri-cpu-line', color: 'green'},
|
||||
{key: 'cpus_count', label: 'CPU处理器', icon: 'ri-memory-line', color: 'purple'},
|
||||
{key: 'cpus_count', label: 'CPU处理器', icon: 'ri-cpu-line', color: 'purple'},
|
||||
{key: 'knowledge_count', label: '知识条目', icon: 'ri-book-open-line', color: 'teal'}
|
||||
];
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>知识库 - ParamHub</title>
|
||||
<title>ParamHub - 参数百科</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||
</head>
|
||||
@@ -75,7 +76,7 @@
|
||||
<!-- 显存计算 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6">
|
||||
<h2 class="text-lg font-semibold text-gray-800 mb-4 flex items-center gap-2">
|
||||
<i class="ri-memory-line text-orange-600"></i>
|
||||
<i class="ri-cpu-line text-orange-600"></i>
|
||||
如何计算显存需求?
|
||||
</h2>
|
||||
<p class="text-gray-600 leading-relaxed">
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>模型数据库 - ParamHub</title>
|
||||
<title>ParamHub - 参数百科</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||
</head>
|
||||
@@ -31,6 +32,19 @@
|
||||
<p class="text-gray-500 mt-1">AI大模型参数规格一览</p>
|
||||
</div>
|
||||
|
||||
<!-- 子类别选择器 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-4 mb-4">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<span class="text-sm text-gray-600"><i class="ri-folder-line mr-1"></i>子类别:</span>
|
||||
</div>
|
||||
<div class="flex gap-2" id="subcategoryTabs">
|
||||
<button onclick="selectSubcategory('')" class="px-4 py-2 bg-indigo-600 text-white rounded-lg text-sm" id="subcat-all">
|
||||
<i class="ri-apps-line mr-1"></i>全部
|
||||
</button>
|
||||
<!-- 动态加载子类别 -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 搜索和筛选 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-4 mb-6">
|
||||
<div class="flex gap-4 items-center">
|
||||
@@ -41,14 +55,18 @@
|
||||
oninput="loadModels()">
|
||||
</div>
|
||||
<select id="sortBy" class="px-4 py-2 border border-gray-200 rounded-lg" onchange="loadModels()">
|
||||
<option value="default">默认排序(置顶优先)</option>
|
||||
<option value="publish_date">按发布日期</option>
|
||||
<option value="views">按热度</option>
|
||||
<option value="name">按名称</option>
|
||||
<option value="parameters">按参数量</option>
|
||||
<option value="mmlu">按MMLU分数</option>
|
||||
<option value="context_length">按上下文长度</option>
|
||||
<option value="created_at">按创建时间</option>
|
||||
</select>
|
||||
<select id="sortOrder" class="px-4 py-2 border border-gray-200 rounded-lg" onchange="loadModels()">
|
||||
<option value="asc">升序</option>
|
||||
<option value="desc">降序</option>
|
||||
<option value="asc">升序</option>
|
||||
</select>
|
||||
<select id="filterType" class="px-4 py-2 border border-gray-200 rounded-lg" onchange="loadModels()">
|
||||
<option value="all">全部</option>
|
||||
@@ -96,12 +114,38 @@
|
||||
<script>
|
||||
let allModels = [];
|
||||
let categories = [];
|
||||
let currentCategory = null;
|
||||
let currentSubcategory = '';
|
||||
|
||||
// 子类别默认特性配置
|
||||
const DEFAULT_KEY_FEATURES = {
|
||||
'chat': ['context_length', 'mmlu', 'input_price', 'output_price'],
|
||||
'code': ['humaneval', 'context_length', 'input_price'],
|
||||
'reasoning': ['mmlu', 'context_length', 'parameters'],
|
||||
'vision': ['context_length', 'mmlu', 'input_price']
|
||||
};
|
||||
|
||||
const FEATURE_LABELS = {
|
||||
'context_length': '上下文',
|
||||
'mmlu': 'MMLU',
|
||||
'humaneval': 'HumanEval',
|
||||
'input_price': '输入价',
|
||||
'output_price': '输出价',
|
||||
'parameters': '参数量',
|
||||
'reasoning_capability': '推理',
|
||||
'vision_capability': '视觉',
|
||||
'multimodal': '多模态'
|
||||
};
|
||||
|
||||
// 加载导航栏
|
||||
async function loadNav() {
|
||||
const res = await fetch('/api/categories');
|
||||
categories = await res.json();
|
||||
|
||||
// 获取当前类别的子类别
|
||||
currentCategory = categories.find(c => c.id === 'ai-models');
|
||||
renderSubcategoryTabs();
|
||||
|
||||
const builtinPages = [
|
||||
{name: '首页', href: '/'},
|
||||
{name: '工具', href: '/tools'},
|
||||
@@ -129,6 +173,49 @@
|
||||
|
||||
document.getElementById('topNav').innerHTML = navHtml;
|
||||
}
|
||||
|
||||
// 渲染子类别选择器
|
||||
function renderSubcategoryTabs() {
|
||||
const container = document.getElementById('subcategoryTabs');
|
||||
if (!currentCategory || !currentCategory.subcategories) {
|
||||
container.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
let html = `<button onclick="selectSubcategory('')" class="px-4 py-2 ${currentSubcategory === '' ? 'bg-indigo-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'} rounded-lg text-sm" id="subcat-all">
|
||||
<i class="ri-apps-line mr-1"></i>全部
|
||||
</button>`;
|
||||
|
||||
currentCategory.subcategories.forEach(sub => {
|
||||
const isActive = currentSubcategory === sub.id;
|
||||
html += `<button onclick="selectSubcategory('${sub.id}')" class="px-4 py-2 ${isActive ? 'bg-indigo-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'} rounded-lg text-sm" id="subcat-${sub.id}">
|
||||
<i class="${sub.icon || 'ri-folder-line'} mr-1"></i>${sub.name}
|
||||
</button>`;
|
||||
});
|
||||
|
||||
container.innerHTML = html;
|
||||
}
|
||||
|
||||
// 选择子类别
|
||||
function selectSubcategory(subId) {
|
||||
currentSubcategory = subId;
|
||||
renderSubcategoryTabs();
|
||||
loadModels();
|
||||
}
|
||||
|
||||
// 获取当前子类别的关键特性
|
||||
function getKeyFeatures() {
|
||||
if (!currentSubcategory || !currentCategory || !currentCategory.subcategories) {
|
||||
return ['parameters', 'context_length', 'mmlu', 'input_price'];
|
||||
}
|
||||
|
||||
const subcat = currentCategory.subcategories.find(s => s.id === currentSubcategory);
|
||||
if (subcat && subcat.key_features) {
|
||||
return subcat.key_features;
|
||||
}
|
||||
|
||||
return ['parameters', 'context_length', 'mmlu', 'input_price'];
|
||||
}
|
||||
|
||||
async function loadModels() {
|
||||
const keyword = document.getElementById('searchInput').value.trim();
|
||||
@@ -150,6 +237,21 @@
|
||||
models = models.filter(m => !m.is_open_source);
|
||||
}
|
||||
|
||||
// 子类别过滤(通过模型名称/描述中的关键词判断)
|
||||
if (currentSubcategory && currentCategory && currentCategory.subcategories) {
|
||||
const subcat = currentCategory.subcategories.find(s => s.id === currentSubcategory);
|
||||
if (subcat) {
|
||||
// 简化过滤:根据子类别关键词匹配
|
||||
// 实际应该有 subcategory_id 字段,这里暂时用名称匹配
|
||||
// 用户可以在后台编辑时指定子类别
|
||||
models = models.filter(m => {
|
||||
const subcatField = m.subcategory || m.subcategory_id;
|
||||
if (subcatField) return subcatField === currentSubcategory;
|
||||
return true; // 暂时显示全部,等后台支持子类别字段后再过滤
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
renderModels(models);
|
||||
}
|
||||
|
||||
@@ -161,38 +263,93 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const html = models.map(m => `
|
||||
<tr class="border-b hover:bg-gray-50 transition">
|
||||
// 动态获取关键特性
|
||||
const keyFeatures = getKeyFeatures();
|
||||
|
||||
// 动态表头
|
||||
let headerHtml = `
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left text-sm font-medium text-gray-600">模型名称</th>
|
||||
<th class="px-4 py-3 text-left text-sm font-medium text-gray-600">厂商</th>
|
||||
`;
|
||||
|
||||
keyFeatures.forEach(f => {
|
||||
headerHtml += `<th class="px-4 py-3 text-left text-sm font-medium text-gray-600">${FEATURE_LABELS[f] || f}</th>`;
|
||||
});
|
||||
|
||||
headerHtml += `
|
||||
<th class="px-4 py-3 text-left text-sm font-medium text-gray-600">类型</th>
|
||||
<th class="px-4 py-3 text-center text-sm font-medium text-gray-600">操作</th>
|
||||
</tr>
|
||||
`;
|
||||
|
||||
document.querySelector('#modelsTable thead').innerHTML = headerHtml;
|
||||
|
||||
// 动态内容
|
||||
const html = models.map(m => {
|
||||
let rowHtml = `
|
||||
<tr class="border-b hover:bg-gray-50 transition ${m.is_pinned ? 'bg-yellow-50' : ''}">
|
||||
<td class="px-4 py-3">
|
||||
<div class="font-medium text-gray-800">${m.name}</div>
|
||||
<div class="text-xs text-gray-500">${m.architecture || ''}</div>
|
||||
<div class="flex items-center gap-2">
|
||||
${m.is_pinned ? '<i class="ri-pushpin-fill text-yellow-500" title="置顶"></i>' : ''}
|
||||
<div>
|
||||
<div class="font-medium text-gray-800">${m.name}</div>
|
||||
<div class="text-xs text-gray-500">${m.architecture || ''}</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-gray-600">${m.organization}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="px-2 py-1 bg-blue-100 text-blue-700 rounded text-sm">${m.parameters}B</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-gray-600">${formatContext(m.context_length)}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="px-2 py-1 bg-green-100 text-green-700 rounded text-sm">${m.mmlu || '-'}%</span>
|
||||
</td>
|
||||
`;
|
||||
|
||||
// 关键特性列
|
||||
keyFeatures.forEach(f => {
|
||||
const value = formatFeatureValue(f, m);
|
||||
rowHtml += `<td class="px-4 py-3">${value}</td>`;
|
||||
});
|
||||
|
||||
rowHtml += `
|
||||
<td class="px-4 py-3">
|
||||
${m.is_open_source
|
||||
? '<span class="px-2 py-1 bg-emerald-100 text-emerald-700 rounded text-sm">开源</span>'
|
||||
: '<span class="px-2 py-1 bg-gray-100 text-gray-700 rounded text-sm">商业</span>'}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-sm text-gray-600">
|
||||
${m.input_price ? `$${m.input_price}/$${m.output_price}` : '免费'}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<button onclick="showDetail('${m.id}')" class="text-indigo-600 hover:text-indigo-800 text-sm">
|
||||
<i class="ri-eye-line mr-1"></i>详情
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
`).join('');
|
||||
`;
|
||||
|
||||
return rowHtml;
|
||||
}).join('');
|
||||
|
||||
document.getElementById('modelsTable').innerHTML = html;
|
||||
}
|
||||
|
||||
// 格式化特性值
|
||||
function formatFeatureValue(feature, model) {
|
||||
const value = model[feature];
|
||||
|
||||
if (value === null || value === undefined) return '<span class="text-gray-400">-</span>';
|
||||
|
||||
switch (feature) {
|
||||
case 'parameters':
|
||||
return `<span class="px-2 py-1 bg-blue-100 text-blue-700 rounded text-sm">${value}B</span>`;
|
||||
case 'context_length':
|
||||
return `<span class="text-gray-600">${formatContext(value)}</span>`;
|
||||
case 'mmlu':
|
||||
return `<span class="px-2 py-1 bg-green-100 text-green-700 rounded text-sm">${value}%</span>`;
|
||||
case 'humaneval':
|
||||
return `<span class="px-2 py-1 bg-purple-100 text-purple-700 rounded text-sm">${value}%</span>`;
|
||||
case 'input_price':
|
||||
return `<span class="text-sm text-gray-600">$${value || 0}</span>`;
|
||||
case 'output_price':
|
||||
return `<span class="text-sm text-gray-600">$${value || 0}</span>`;
|
||||
default:
|
||||
return `<span class="text-gray-600">${value}</span>`;
|
||||
}
|
||||
}
|
||||
|
||||
function formatContext(len) {
|
||||
if (!len) return '-';
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>实用工具 - ParamHub</title>
|
||||
<title>ParamHub - 参数百科</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||
</head>
|
||||
@@ -33,7 +34,7 @@
|
||||
<!-- 显存计算器 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
|
||||
<h2 class="text-lg font-semibold text-gray-800 mb-4 flex items-center gap-2">
|
||||
<i class="ri-memory-line text-green-600"></i>
|
||||
<i class="ri-cpu-line text-green-600"></i>
|
||||
显存计算器
|
||||
</h2>
|
||||
<p class="text-gray-500 mb-4">计算大模型所需的显存大小,并推荐合适的GPU</p>
|
||||
|
||||
Reference in New Issue
Block a user