LLMDataGenerator / README.md
Chaos0818's picture
format
cc49bd1
|
Raw History Blame Contribute Delete
1.73 kB

A newer version of the Gradio SDK is available: 6.32.0

Upgrade
metadata
title: LLMDataGenerator
emoji: 🌍
colorFrom: pink
colorTo: pink
sdk: gradio
sdk_version: 5.32.0
app_file: main.py
pinned: false
license: mit
short_description: LLMDataGenerator
python_version: 3.13.2

LLMDataGenerator

题库生成工具,支持PDF和JSON格式输入,可以通过OCR和LLM模型将试题转换为结构化数据。

功能特点

  • 支持PDF和JSON格式输入
  • OCR识别支持(仅PDF格式需要)
  • LLM模型处理
  • 实时处理状态展示
  • 结构化数据输出

环境要求

pip install -r requirements.txt

安装

# 创建虚拟环境
conda create -n llm_data python=3.8
conda activate llm_data

# 安装依赖
pip install -r requirements.txt

同步推送到HF

# 拉下来代码之后
git remote remove space
git remote add space [hf 链接]
git push --force space main

配置

在项目根目录创建 config.yaml 文件:

ocr:
  apikey: "your-ocr-api-key"
llm:
  apikey: "your-llm-api-key"

运行

python main.py

使用说明

  1. 选择输入文件格式(PDF/JSON)
  2. 上传文件(支持多文件)
  3. 选择OCR接口(仅PDF格式需要)
  4. 选择LLM模型
  5. 点击"开始处理"按钮
  6. 查看实时处理日志

输出格式

处理后的文件将保存在 temp_files/{timestamp}/out 目录下:

  • JSONL格式的结构化数据
  • 相关图片资源

目录结构

LLMDataGenerator/
├── main.py           # 主程序
├── config.yaml       # 配置文件
├── llms/            # LLM模型相关
├── ocr/             # OCR处理相关
├── utils/           # 工具函数
├── temp_files/      # 临时文件目录
└── README.md