ChatGLM3-6B模型安全指南:敏感内容过滤与合规部署
ChatGLM3-6B模型安全指南敏感内容过滤与合规部署最近在帮一个朋友的公司部署ChatGLM3-6B他们想用这个模型做个内部的知识库问答系统。部署过程挺顺利的但聊到内容安全时朋友突然问“这模型要是被问到不该问的问题会不会乱说话”这个问题问得很实在。大模型确实很强大但如果不加约束确实可能生成一些不合适的内容。特别是在企业环境下内容安全合规是必须考虑的问题。今天我就结合自己的实践经验聊聊怎么给ChatGLM3-6B加上“安全护栏”让它既能发挥价值又不会“说错话”。1. 为什么需要内容安全防护先说说为什么这个问题这么重要。大模型就像个知识渊博但涉世未深的学生它学了很多东西但不知道哪些话能说、哪些话不能说。在实际应用中我们可能会遇到几种情况用户无意中问了敏感问题比如涉及隐私、不当内容等模型理解偏差模型可能误解用户意图生成不合适的内容恶意测试有人故意测试模型的边界如果不做防护轻则影响用户体验重则可能带来合规风险。所以给模型加上安全机制就像给汽车装上安全带——平时可能用不上但关键时刻能避免大问题。2. 基础部署与环境准备在讲安全防护之前咱们先快速过一遍基础部署。如果你已经部署好了可以直接跳到下一节。2.1 环境要求ChatGLM3-6B对硬件要求不算太高但也要做好准备内存至少16GB推荐32GB显存至少13GBFP16精度存储模型文件约13GBPython3.8及以上版本2.2 快速安装安装过程其实挺简单的跟着下面几步走就行# 1. 克隆代码仓库 git clone https://github.com/THUDM/ChatGLM3 cd ChatGLM3 # 2. 安装依赖 pip install -r requirements.txt # 3. 下载模型如果网络慢可以用镜像源 # 官方源 git clone https://huggingface.co/THUDM/chatglm3-6b # 或者用国内镜像 git clone https://www.modelscope.cn/ZhipuAI/chatglm3-6b.git2.3 基础测试部署完成后先做个简单测试看看模型能不能正常工作from transformers import AutoTokenizer, AutoModel # 加载模型和分词器 tokenizer AutoTokenizer.from_pretrained(./chatglm3-6b, trust_remote_codeTrue) model AutoModel.from_pretrained(./chatglm3-6b, trust_remote_codeTrue, devicecuda) model model.eval() # 测试对话 response, history model.chat(tokenizer, 你好介绍一下你自己, history[]) print(f模型回复{response})如果能看到正常的回复说明基础部署成功了。接下来咱们重点聊聊怎么给这个模型加上安全防护。3. 三层安全防护方案我通常建议采用三层防护策略从输入到输出全方位保障内容安全。这三层分别是输入过滤、过程监控、输出审核。3.1 第一层输入关键词过滤这是最基础也是最重要的一层。在用户问题进入模型之前我们先检查一下里面有没有敏感词。3.1.1 构建关键词库首先需要建立一个敏感词库。这个词库可以根据你的业务场景来定制class KeywordFilter: def __init__(self): # 基础敏感词库示例 self.sensitive_keywords { # 不当内容相关 不当内容: [暴力, 血腥, 色情, 赌博, 毒品], # 隐私相关 隐私信息: [身份证号, 手机号, 银行卡, 密码, 住址], # 其他需要过滤的内容 其他: [诈骗, 传销, 侵权] } # 可以动态加载外部词库 self.load_external_keywords() def load_external_keywords(self): 从文件加载额外的关键词 try: with open(sensitive_words.txt, r, encodingutf-8) as f: external_words [line.strip() for line in f if line.strip()] self.sensitive_keywords[外部词库] external_words except FileNotFoundError: print(未找到外部词库文件使用内置词库) def check_input(self, user_input): 检查用户输入 issues [] for category, words in self.sensitive_keywords.items(): for word in words: if word in user_input: issues.append({ category: category, keyword: word, position: user_input.find(word) }) return issues3.1.2 智能过滤策略单纯的词匹配可能会误伤比如“我今天去银行办理业务”里的“银行”并不是敏感词。我们可以加一些智能判断class SmartKeywordFilter(KeywordFilter): def __init__(self): super().__init__() # 添加上下文判断规则 self.context_rules { 银行: [办理, 业务, 存款, 取款], # 这些词附近的银行是正常的 密码: [设置, 修改, 忘记], # 这些场景下的密码可能是正常的 } def check_with_context(self, user_input): 带上下文的检查 basic_issues self.check_input(user_input) filtered_issues [] for issue in basic_issues: keyword issue[keyword] # 检查是否有合法的上下文 if keyword in self.context_rules: context_valid False for valid_word in self.context_rules[keyword]: if valid_word in user_input: context_valid True break if context_valid: continue # 上下文合法跳过这个检测 filtered_issues.append(issue) return filtered_issues3.2 第二层输出可信度评估有时候用户的问题本身没问题但模型的回答可能不太合适。这时候我们需要对模型的输出进行评估。3.2.1 置信度评分给模型的回答打个分看看它有多“确定”class OutputEvaluator: def __init__(self, model, tokenizer): self.model model self.tokenizer tokenizer def evaluate_confidence(self, response, historyNone): 评估回答的置信度 返回0-1的分数越高表示越可信 if history is None: history [] # 方法1检查回答长度太短可能有问题 if len(response) 10: length_score 0.3 elif len(response) 500: length_score 0.8 else: length_score 0.6 # 方法2检查是否有不确定的表述 uncertain_phrases [我不确定, 可能, 也许, 大概, 或许] uncertainty_count sum(1 for phrase in uncertain_phrases if phrase in response) uncertainty_score max(0, 1 - uncertainty_count * 0.2) # 方法3检查重复内容重复可能表示模型在编造 words response.split() unique_words set(words) repetition_score len(unique_words) / len(words) if words else 1.0 # 综合评分 final_score (length_score * 0.3 uncertainty_score * 0.3 repetition_score * 0.4) return { score: round(final_score, 2), details: { length_score: length_score, uncertainty_score: uncertainty_score, repetition_score: repetition_score } }3.2.2 内容安全检查除了置信度还要检查回答内容本身def check_content_safety(self, response): 检查回答内容的安全性 safety_issues [] # 检查是否包含敏感信息 sensitive_info_patterns [ r\d{18}|\d{17}X, # 身份证号 r1[3-9]\d{9}, # 手机号 r\d{16,19}, # 银行卡号 ] import re for pattern in sensitive_info_patterns: if re.search(pattern, response): safety_issues.append(检测到可能的敏感信息) # 检查是否有不当建议 dangerous_advice [自杀, 自残, 伤害他人, 违法] for advice in dangerous_advice: if advice in response: safety_issues.append(f检测到不当建议{advice}) # 检查是否有偏激言论 extreme_words [必须, 绝对, 一定, 永远] extreme_count sum(1 for word in extreme_words if word in response) if extreme_count 3: safety_issues.append(回答语气可能过于绝对) return safety_issues3.3 第三层审计日志记录所有交互都要记录下来这样出了问题可以追溯也能用来优化模型。3.3.1 日志记录系统import json import time from datetime import datetime class AuditLogger: def __init__(self, log_filechat_audit.log): self.log_file log_file def log_interaction(self, user_input, model_response, safety_checks, user_idNone): 记录一次完整的交互 log_entry { timestamp: datetime.now().isoformat(), user_id: user_id or anonymous, user_input: user_input, model_response: model_response, safety_checks: safety_checks, input_issues: safety_checks.get(input_issues, []), output_issues: safety_checks.get(output_issues, []), confidence_score: safety_checks.get(confidence_score, 0), response_time: time.time() } # 写入日志文件 with open(self.log_file, a, encodingutf-8) as f: f.write(json.dumps(log_entry, ensure_asciiFalse) \n) # 如果有严重问题额外记录到单独文件 if (safety_checks.get(input_issues) or safety_checks.get(output_issues)): self.log_security_issue(log_entry) def log_security_issue(self, log_entry): 记录安全问题到单独文件 security_file security_issues.log with open(security_file, a, encodingutf-8) as f: f.write(json.dumps(log_entry, ensure_asciiFalse) \n) def get_recent_logs(self, limit100): 获取最近的日志 try: with open(self.log_file, r, encodingutf-8) as f: lines f.readlines()[-limit:] return [json.loads(line) for line in lines] except FileNotFoundError: return []3.3.2 定期审计分析有了日志我们还可以定期分析class AuditAnalyzer: def __init__(self, logger): self.logger logger def analyze_security_trends(self, days7): 分析安全趋势 logs self.logger.get_recent_logs(limit1000) analysis { total_interactions: len(logs), security_issues: 0, issues_by_type: {}, high_risk_users: {}, common_problem_patterns: [] } for log in logs: if log[input_issues] or log[output_issues]: analysis[security_issues] 1 # 按类型统计 for issue in log[input_issues] log[output_issues]: issue_type issue.get(category, unknown) analysis[issues_by_type][issue_type] \ analysis[issues_by_type].get(issue_type, 0) 1 # 高风险用户 user_id log[user_id] if user_id ! anonymous: analysis[high_risk_users][user_id] \ analysis[high_risk_users].get(user_id, 0) 1 return analysis def generate_report(self): 生成审计报告 analysis self.analyze_security_trends() report f 安全审计报告 生成时间{datetime.now().strftime(%Y-%m-%d %H:%M:%S)} 总体统计 - 总交互次数{analysis[total_interactions]} - 安全问题次数{analysis[security_issues]} - 安全问题比例{analysis[security_issues]/max(analysis[total_interactions], 1)*100:.2f}% 问题类型分布 for issue_type, count in analysis[issues_by_type].items(): report f- {issue_type}: {count}次\n if analysis[high_risk_users]: report \n需要关注的用户\n for user, count in list(analysis[high_risk_users].items())[:5]: # 只显示前5个 report f- 用户 {user}: {count}次安全问题\n return report4. 完整的安全对话系统现在我们把所有组件组合起来创建一个完整的安全对话系统class SafeChatGLM: def __init__(self, model_path./chatglm3-6b): # 初始化各个组件 self.tokenizer AutoTokenizer.from_pretrained( model_path, trust_remote_codeTrue ) self.model AutoModel.from_pretrained( model_path, trust_remote_codeTrue, devicecuda ).eval() self.keyword_filter SmartKeywordFilter() self.evaluator OutputEvaluator(self.model, self.tokenizer) self.logger AuditLogger() self.analyzer AuditAnalyzer(self.logger) # 安全响应模板 self.safe_responses { sensitive_input: 抱歉我无法回答这个问题。请问还有其他我可以帮助的吗, low_confidence: 这个问题我不太确定建议您咨询相关领域的专业人士。, content_issue: 我可能无法提供准确的回答请换一种方式提问试试。 } def chat(self, user_input, user_idNone, historyNone): 安全对话接口 if history is None: history [] # 1. 输入检查 input_issues self.keyword_filter.check_with_context(user_input) if input_issues: # 记录并返回安全响应 safety_data { input_issues: input_issues, output_issues: [], confidence_score: 0, action: blocked_input } self.logger.log_interaction( user_input, self.safe_responses[sensitive_input], safety_data, user_id ) return self.safe_responses[sensitive_input], history # 2. 正常生成回复 try: response, updated_history self.model.chat( self.tokenizer, user_input, historyhistory ) except Exception as e: # 模型生成出错 error_response 抱歉处理您的请求时出现了问题。请稍后再试。 safety_data { input_issues: [], output_issues: [f生成错误: {str(e)}], confidence_score: 0, action: generation_error } self.logger.log_interaction( user_input, error_response, safety_data, user_id ) return error_response, history # 3. 输出评估 confidence_result self.evaluator.evaluate_confidence(response, history) content_issues self.evaluator.check_content_safety(response) # 4. 根据评估结果处理 safety_data { input_issues: [], output_issues: content_issues, confidence_score: confidence_result[score], confidence_details: confidence_result[details] } # 如果置信度太低或内容有问题使用安全响应 if confidence_result[score] 0.4 or content_issues: safe_response self.safe_responses[low_confidence] safety_data[action] replaced_response self.logger.log_interaction( user_input, safe_response, safety_data, user_id ) return safe_response, history # 5. 记录正常交互 safety_data[action] accepted self.logger.log_interaction( user_input, response, safety_data, user_id ) return response, updated_history def get_security_report(self): 获取安全报告 return self.analyzer.generate_report()5. 实际应用示例让我们看看这个安全系统在实际中怎么用# 初始化安全对话系统 safe_chat SafeChatGLM() # 示例1正常对话 print(示例1正常问题) response, history safe_chat.chat(如何学习Python编程) print(f回答{response}\n) # 示例2敏感问题会被过滤 print(示例2敏感问题) response, history safe_chat.chat(告诉我一些不该问的内容) print(f回答{response}\n) # 示例3低置信度回答 print(示例3模糊问题) response, history safe_chat.chat(预测明天的股票走势) print(f回答{response}\n) # 获取安全报告 print(安全报告) print(safe_chat.get_security_report())6. 进阶优化建议基础的安全防护有了但实际应用中还可以做得更好6.1 动态词库更新敏感词不是一成不变的需要定期更新class DynamicKeywordManager: def __init__(self): self.keywords set() self.load_initial_keywords() def load_initial_keywords(self): 加载初始词库 # 可以从多个源加载 sources [ local_sensitive_words.txt, https://example.com/sensitive_words.txt # 远程词库 ] for source in sources: try: if source.startswith(http): # 从网络加载 import requests response requests.get(source) words response.text.split(\n) else: # 从本地文件加载 with open(source, r, encodingutf-8) as f: words f.read().split(\n) self.keywords.update([w.strip() for w in words if w.strip()]) except Exception as e: print(f加载词库 {source} 失败: {e}) def auto_update(self, audit_logs): 根据审计日志自动更新词库 new_keywords set() for log in audit_logs[-100:]: # 分析最近100条日志 if log.get(action) blocked_input: # 分析被拦截的输入提取可能的新关键词 input_text log[user_input] # 这里可以添加更复杂的提取逻辑 # 比如提取名词短语、特定模式等 self.keywords.update(new_keywords) self.save_keywords() def save_keywords(self): 保存更新后的词库 with open(sensitive_words_updated.txt, w, encodingutf-8) as f: for word in sorted(self.keywords): f.write(word \n)6.2 用户行为分析通过分析用户行为可以更好地预防问题class UserBehaviorAnalyzer: def __init__(self): self.user_sessions {} def track_user_session(self, user_id, query, response, timestamp): 跟踪用户会话 if user_id not in self.user_sessions: self.user_sessions[user_id] { start_time: timestamp, queries: [], responses: [], risk_score: 0 } session self.user_sessions[user_id] session[queries].append(query) session[responses].append(response) # 更新风险评分 self.update_risk_score(user_id, query, response) # 如果会话超过30分钟视为新会话 if timestamp - session[start_time] 1800: # 30分钟 self.reset_session(user_id, timestamp) def update_risk_score(self, user_id, query, response): 更新用户风险评分 session self.user_sessions[user_id] risk_factors { query_length: len(query) 500, # 超长查询 rapid_queries: len(session[queries]) 10, # 频繁查询 repeated_queries: self.check_repetition(session[queries]), sensitive_patterns: self.check_sensitive_patterns(query) } # 计算风险分 risk_score sum(1 for factor in risk_factors.values() if factor) session[risk_score] risk_score # 高风险用户特殊处理 if risk_score 3: self.flag_high_risk_user(user_id) def check_repetition(self, queries): 检查查询重复性 if len(queries) 3: return False last_three queries[-3:] # 简单的重复检测 return len(set(last_three)) 2 def check_sensitive_patterns(self, query): 检查敏感模式 patterns [ r如何.*获取.*信息, # 模糊的信息获取请求 r能不能.*告诉.*秘密, # 涉及秘密的请求 r绕过.*限制, # 试图绕过限制 ] import re for pattern in patterns: if re.search(pattern, query, re.IGNORECASE): return True return False def flag_high_risk_user(self, user_id): 标记高风险用户 print(f警告用户 {user_id} 被标记为高风险) # 这里可以触发警报、限制频率等操作6.3 性能优化安全检查不能太影响性能需要做些优化class OptimizedSafetySystem(SafeChatGLM): def __init__(self, model_path./chatglm3-6b): super().__init__(model_path) # 使用缓存提高性能 self.query_cache {} self.cache_size 1000 # 异步处理 import threading self.logging_thread None def chat(self, user_input, user_idNone, historyNone): 优化版的安全对话 # 1. 缓存检查 cache_key f{user_id}:{user_input} if cache_key in self.query_cache: cached self.query_cache[cache_key] if time.time() - cached[timestamp] 300: # 5分钟缓存 return cached[response], cached[history] # 2. 快速关键词检查使用布隆过滤器等优化 if self.quick_keyword_check(user_input): return self.safe_responses[sensitive_input], history or [] # 3. 异步日志记录 if self.logging_thread is None or not self.logging_thread.is_alive(): self.logging_thread threading.Thread( targetself.async_logging, args(user_input, user_id) ) self.logging_thread.start() # 4. 正常处理流程 response, updated_history super().chat(user_input, user_id, history) # 5. 更新缓存 if len(self.query_cache) self.cache_size: # 移除最旧的缓存 oldest_key next(iter(self.query_cache)) del self.query_cache[oldest_key] self.query_cache[cache_key] { response: response, history: updated_history, timestamp: time.time() } return response, updated_history def quick_keyword_check(self, text): 快速关键词检查 # 这里可以使用更高效的数据结构如布隆过滤器 high_risk_words [暴力, 色情, 诈骗] # 高风险词短列表 return any(word in text for word in high_risk_words) def async_logging(self, user_input, user_id): 异步记录日志 # 这里可以添加异步处理逻辑 pass7. 部署与监控7.1 部署配置在实际部署时建议这样配置# config.yaml safety_config: # 关键词过滤配置 keyword_filter: enabled: true update_frequency: 3600 # 每小时更新一次词库 external_sources: - https://example.com/sensitive_words.txt - /path/to/local/keywords.txt # 输出评估配置 output_evaluation: min_confidence: 0.4 # 最低置信度阈值 check_sensitive_info: true check_dangerous_content: true # 审计日志配置 audit_logging: enabled: true log_file: /var/log/chatglm/audit.log security_log_file: /var/log/chatglm/security.log retention_days: 30 # 用户行为分析 user_analysis: enabled: true session_timeout: 1800 # 30分钟 risk_threshold: 3 # 风险阈值 # 性能优化 performance: cache_enabled: true cache_size: 1000 cache_ttl: 300 # 5分钟7.2 监控告警设置监控系统及时发现问题class SafetyMonitor: def __init__(self, config_pathconfig.yaml): self.load_config(config_path) self.alerts_sent set() def load_config(self, config_path): 加载配置 import yaml with open(config_path, r, encodingutf-8) as f: self.config yaml.safe_load(f) def check_metrics(self, metrics): 检查各项指标 alerts [] # 检查安全事件频率 if metrics.get(security_events_per_hour, 0) 10: alert 安全事件频率过高 if alert not in self.alerts_sent: alerts.append(alert) self.alerts_sent.add(alert) # 检查高风险用户 high_risk_users metrics.get(high_risk_users, []) if len(high_risk_users) 5: alert f发现{len(high_risk_users)}个高风险用户 if alert not in self.alerts_sent: alerts.append(alert) self.alerts_sent.add(alert) # 检查系统性能 if metrics.get(avg_response_time, 0) 5.0: # 超过5秒 alert 系统响应时间过长 if alert not in self.alerts_sent: alerts.append(alert) self.alerts_sent.add(alert) return alerts def send_alert(self, alert, levelwarning): 发送告警 # 这里可以实现邮件、短信、钉钉等告警方式 print(f[{level.upper()}] {alert}) # 示例发送到日志文件 with open(alerts.log, a, encodingutf-8) as f: f.write(f{datetime.now()} [{level}] {alert}\n)8. 总结给ChatGLM3-6B加上安全防护其实就像给一个聪明的助手配了个“安全顾问”。这个顾问会在三个关键环节把关用户提问时检查问题是否合适模型回答时评估内容是否可靠整个过程都有记录可查。实际用下来这套方案效果还不错。输入过滤能挡住大部分明显的问题输出评估能发现模型“没把握”的回答审计日志则让我们能随时了解系统运行状况。当然没有绝对完美的安全方案关键是要根据实际使用情况不断调整优化。如果你也在用ChatGLM3-6B建议至少实现基础的三层防护。先从关键词过滤开始慢慢加上输出评估和日志记录。随着使用时间增长你会积累更多数据也能更好地优化安全策略。安全防护不是一次性的工作而是个持续的过程。模型在变使用场景在变安全策略也要跟着变。保持警惕定期审查才能让AI助手既聪明又可靠。获取更多AI镜像想探索更多AI镜像和应用场景访问 CSDN星图镜像广场提供丰富的预置镜像覆盖大模型推理、图像生成、视频生成、模型微调等多个领域支持一键部署。

相关新闻

GTE中文文本嵌入模型快速入门:文本处理新利器

GTE中文文本嵌入模型快速入门:文本处理新利器

GTE中文文本嵌入模型快速入门:文本处理新利器 在信息检索、智能客服、内容推荐等实际业务中,你是否遇到过这些困扰? 用户搜索“苹果手机维修”,结果却返回一堆水果种植指南;客服系统无法识别“我刚买的iPhone15屏幕碎…

2026/7/3 17:55:52 阅读更多 →
微信小程序开发新范式:集成浦语灵笔2.5-7B实现智能客服

微信小程序开发新范式:集成浦语灵笔2.5-7B实现智能客服

微信小程序开发新范式:集成浦语灵笔2.5-7B实现智能客服 你有没有想过,在你的微信小程序里,可以有一个能看懂用户上传的商品图片、能听懂语音提问、还能像真人一样跟你聊天的客服? 这不是科幻电影里的场景。现在,借助…

2026/7/7 2:13:51 阅读更多 →
Gemma-3-270m多场景落地:新闻摘要、财报分析、政策文件解读三类实操

Gemma-3-270m多场景落地:新闻摘要、财报分析、政策文件解读三类实操

Gemma-3-270m多场景落地:新闻摘要、财报分析、政策文件解读三类实操 你是不是经常被海量的信息淹没?每天要看几十篇新闻,分析厚厚的财报,或者解读复杂的政策文件,感觉时间完全不够用? 今天,我…

2026/7/3 22:36:40 阅读更多 →

最新新闻

STM32F745VG与13DOF传感器融合的嵌入式导航方案

STM32F745VG与13DOF传感器融合的嵌入式导航方案

1. 项目背景与核心价值在嵌入式系统开发领域,精确的定位与导航能力一直是工业级应用的核心需求。传统方案往往面临两个关键痛点:单一定位源(如GPS)在复杂环境下的可靠性不足,以及高精度多传感器融合方案的高成本门槛。…

2026/7/7 15:57:31 阅读更多 →
IIM-42652与dsPIC30F4013实现6DoF运动跟踪系统

IIM-42652与dsPIC30F4013实现6DoF运动跟踪系统

1. IIM-42652与dsPIC30F4013的6DoF运动跟踪系统概述 在现代嵌入式系统开发中,6自由度(6DoF)运动跟踪技术已经成为VR设备、无人机飞控和工业机器人等领域的核心技术。与传统的3D运动感知不同,6DoF系统通过整合3轴加速度计和3轴陀螺…

2026/7/7 15:55:31 阅读更多 →
IIM-42652与PIC18F26K42实现6DoF姿态检测方案

IIM-42652与PIC18F26K42实现6DoF姿态检测方案

1. 从3D到6DoF:IMU传感器的进阶应用 在运动追踪和姿态检测领域,3D空间感知已经不能满足日益增长的需求。6DoF(六自由度)技术通过增加三个旋转维度的测量,实现了对物体运动的完整描述。IIM-42652这款6轴IMU(…

2026/7/7 15:55:31 阅读更多 →
综合面试问你在海外实习的最大收获?留学生用工程闭环逻辑汇报「蒸汽求职分享」

综合面试问你在海外实习的最大收获?留学生用工程闭环逻辑汇报「蒸汽求职分享」

只要海归同学的简历里写了海外本地的实习、兼职或导师实验室项目,综合面试时面试官几乎一定会抛出这个经典问题:“在这段经历里,你觉得自己最大的收获和成长是什么?”很多同学由于缺乏对国内工业界话语体系的对齐,往往…

2026/7/7 15:53:30 阅读更多 →
5个痛点解决!MAA游戏助手如何让《明日方舟》玩家告别重复劳动

5个痛点解决!MAA游戏助手如何让《明日方舟》玩家告别重复劳动

5个痛点解决!MAA游戏助手如何让《明日方舟》玩家告别重复劳动 【免费下载链接】MaaAssistantArknights 《明日方舟》小助手,全日常一键长草!| A one-click tool for the daily tasks of Arknights, supporting all clients. 项目地址: http…

2026/7/7 15:51:29 阅读更多 →
Krita-AI-Diffusion终极优化指南:让低配置电脑也能流畅运行AI绘画

Krita-AI-Diffusion终极优化指南:让低配置电脑也能流畅运行AI绘画

Krita-AI-Diffusion终极优化指南:让低配置电脑也能流畅运行AI绘画 【免费下载链接】krita-ai-diffusion Streamlined interface for generating images with AI in Krita. Inpaint and outpaint with optional text prompt, no tweaking required. 项目地址: http…

2026/7/7 15:51:29 阅读更多 →

日新闻

鸿蒙新特性:图片画廊与轮播导航——构建沉浸式图片浏览体验

鸿蒙新特性:图片画廊与轮播导航——构建沉浸式图片浏览体验

图片浏览是移动应用中最高频的场景之一。从社交应用的照片流到电商平台的商品图集,从旅游应用的景点相册到摄影作品展示——用户对图片浏览的体验要求不断提高:流畅的切换动画、直观的缩略图导航、便捷的收藏操作、自动播放模式。HarmonyOS NEXT ArkUI 虽…

2026/7/7 0:05:16 阅读更多 →
24V DC-DC降压芯片PW2312B/PW2815,SOT23-6到SOP8-EP方案对比

24V DC-DC降压芯片PW2312B/PW2815,SOT23-6到SOP8-EP方案对比

24V稳压芯片完整选型指南 PW8600 PW75XX PW2815 PW2312B LDODC/DC全方案 一、24V稳压方案概述 24V直流电源在工业自动化、门禁系统、电梯控制、汽车电子、LED驱动、监控设备等场景中应用极广,是最常见的中压直流母线电压。要将24V母线稳定降压至下游MCU、传感器…

2026/7/7 0:05:16 阅读更多 →
RAG+知识图谱混合检索与Graph RAG核心对比

RAG+知识图谱混合检索与Graph RAG核心对比

做企业RAG落地的团队,往往容易卡在一容易踩坑的选型难题: 当需求单纯靠向量RAG搞不定、单纯靠知识图谱也搞不定,必须同时依赖「文本语义理解 实体关系推理」时,到底是做「向量图谱混合检索」就够了,还是必须上「Grap…

2026/7/7 0:07:19 阅读更多 →

周新闻

B站视频下载神器BiliTools:5分钟学会轻松保存任何B站内容

B站视频下载神器BiliTools:5分钟学会轻松保存任何B站内容

B站视频下载神器BiliTools:5分钟学会轻松保存任何B站内容 【免费下载链接】BiliTools A cross-platform bilibili toolbox. 跨平台哔哩哔哩工具箱,支持下载视频、番剧等等各类资源 项目地址: https://gitcode.com/GitHub_Trending/bilit/BiliTools …

2026/7/7 14:24:45 阅读更多 →
威胁模型全解析:从新手入门到实战应用,助你构建安全产品!

威胁模型全解析:从新手入门到实战应用,助你构建安全产品!

威胁模型的陌生现状在忙碌疲惫的一天里,参与了关于混合后量子密码学的讨论,应付端点攻击找茬的人,还参与留言板讨论后,发现“威胁模型”对多数人仍是陌生概念,且多被当作时髦用语。有趣的相关画作有一幅由 Embyr 创作的…

2026/7/7 12:34:47 阅读更多 →
渗透测试入门指南:从零基础到实战环境搭建

渗透测试入门指南:从零基础到实战环境搭建

1. 从“看热闹”到“入门”:我理解的渗透测试到底是什么?每次看到新闻里说某个大公司的数据被“黑”了,或者某个网站被攻击导致服务瘫痪,你是不是和我一样,心里会冒出两个念头:一是“这黑客真厉害”&#x…

2026/7/6 6:52:56 阅读更多 →

月新闻