MCPcopy Index your code
hub / github.com/eric1372428/tarrot

github.com/eric1372428/tarrot @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
6 symbols 21 edges 1 files 4 documented · 67%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🔮 AI Tarot Reading Assistant

一个基于大语言模型的智能塔罗牌占卜对话机器人,使用三牌阵为用户的感情、事业、个人成长等问题提供温暖而现实的解读。

✨ 功能特点

  • 🃏 完整塔罗牌库:包含全部78张塔罗牌(22张大阿卡纳 + 56张小阿卡纳)
  • 🎲 随机抽牌:支持自动随机抽取三张牌,也可手动指定牌面
  • 🎯 多领域覆盖:支持感情、事业、个人、财运、学业五大领域
  • 🤖 AI智能解读:基于微调的大语言模型,提供专业的三牌阵解读
  • 💬 友好界面:基于 Gradio 构建的 Web 界面,操作简单直观

🛠️ 技术栈

技术 说明
Python 3.8+ 主要编程语言
PyTorch 深度学习框架
Transformers 模型加载与推理
PEFT / LoRA 模型微调技术
Gradio Web UI 框架

📦 安装与运行

1. 克隆项目

git clone https://github.com/你的用户名/你的仓库名.git
cd 你的仓库名

2. 安装依赖

pip install -r requirements.txt

3. 配置模型

本项目基于 LoRA 微调的大语言模型进行塔罗牌解读。你需要准备:

基础模型:[Qwen2.5-0.5B-Instruct]

LoRA 适配器权重:训练好的模型适配器文件

4. 启动应用

python demo1.py
启动后,终端会显示本地访问地址(通常是 http://127.0.0.1:7860),在浏览器中打开即可使用。

🎮 使用指南

选择领域:从下拉菜单中选择你的问题所属领域(感情/事业/个人/财运/学业)

输入问题:在文本框中写下你想问的问题

例如:"这段感情健康吗?"、"我应该换工作吗?"

抽取牌面:

点击「🎲 Draw Random Cards」随机抽牌

或手动在三张牌的输入框中填写牌名

获取解读:点击「🔮 Get Reading」按钮,AI 会生成详细的塔罗牌解读

📁 项目结构

├── demo1.py              # 主程序文件
├── requirements.txt      # Python 依赖列表
├── README.md            # 项目说明文档
└── [模型文件夹]/         # 模型文件(不包含在仓库中)

模型下载

本项目需要下载微调后的 LoRA 模型,请按以下步骤操作:

  1. 从 [(https://huggingface.co/pp137/tarrot_qwen_lora)] 下载模型文件
  2. 将文件解压到 ./model/ 目录下
  3. 目录结构应为:

AI-Tarot-Assistant/ ├── demo1.py
├── model/
│ ├── chat_template.jinja │ ├── config.json │ ├── generation_config.json │ ├── model.safetensors │ ├── Modelfile │ ├── tokenizer_config.json │ └── tokenizer.json ├── requirements.txt ├── .gitignore └── README.md

🤝 贡献指南

欢迎提交 Issue 和 Pull Request!

Fork 本项目

创建你的功能分支 (git checkout -b feature/AmazingFeature)

提交你的修改 (git commit -m 'Add some AmazingFeature')

推送到分支 (git push origin feature/AmazingFeature)

提交 Pull Request

📄 许可证

本项目采用 MIT 许可证 - 详见 LICENSE 文件

🙏 致谢

Qwen 提供的基座模型

PEFT 高效的参数微调框架

Gradio 简洁的 Web UI 框架

⭐ 如果这个项目对你有帮助,欢迎给个 Star!

Core symbols most depended-on inside this repo

draw_random_cards
called by 2
demo.py
tarot_reading
called by 2
demo.py
create_message_format
called by 1
demo.py
draw_cards
called by 0
demo.py
clear_fields
called by 0
demo.py
get_reading_with_check
called by 0
demo.py

Shape

Function 6

Languages

Python100%

Modules by API surface

demo.py6 symbols

For agents

$ claude mcp add tarrot \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact