中心思想,生成txt文件,再用liberoffice转为PDF
import os
com1="echo "+info_text+":信息 >swap.txt"
com2="libreoffice --convert-to pdf:writer_pdf_Export swap.txt --outdir "+self.download
os.system(com1)
os.system(com2)
- HTML貌似不可用,目前无法修改字体大小
中心思想,生成txt文件,再用liberoffice转为PDF
import os
com1="echo "+info_text+":信息 >swap.txt"
com2="libreoffice --convert-to pdf:writer_pdf_Export swap.txt --outdir "+self.download
os.system(com1)
os.system(com2)
在Intel Mac上进行大模型微调,您可以遵循以下步骤:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
curl -LO https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh bash Miniforge3-MacOSX-x86_64.sh
tensorflow_2
:conda create --name tensorflow_2 python=3.9
conda activate tensorflow_2
pip install tensorflow-macos
import tensorflow as tf print("TensorFlow version:", tf.__version__) print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
json [ { "instruction": "你好", "input": "", "output": "皇上好,我是甄嬛,家父是大理寺少卿甄远道。" }, { "instruction": "你不愿意见我?", "input": "", "output": "不该相见自然不愿见,还望王爷尊重我的意愿。" } ]
train.py
文件中的model_id
变量来选择不同的模型。python train.py
streamlit run chat.py
以上步骤提供了在Intel Mac上进行大模型微调的详细指南,帮助您充分利用现有的硬件资源和软件工具。
TAG
来自KIMI
要义 MLX 针对mac的ARM处理器优化的大模型训练架构
看了那么多资料主要还是PIP安装 huggingface_hub mlx-lm transformers torch numpy
然后对应大模型文件微调
针对数据 Completion(问答类型,一问一答) chat(角色问答) text(单文本类型,训练特定文本) 三种类型 都是JSON格式
chat解析:
{
"messages": [
{
"role": "user",
"content": "How do I use this product?"
},
{
"role": "assistantA",
"content": "To use this product, first insert the batteries and then press the power button."
},
{
"role": "assistantB",
"content": "To operate this product, make sure it's charged, and then follow the instructions in the manual."
}
]
}
message包裹下为信息,role为user的content为询问,assistantB和assistantA给出不同的content
completion解析
[{
"prompt": "What is the capital of France?",
"completion": "Paris."
},
{
"prompt": "A?",
"completion": "BBBB"
}]
TEXT格式
{"text": "table: 1-1000181-1\ncolumns: State/territory, Text/background colour, Format, Current slogan, Current series, Notes\nQ: Tell me what the notes are for South Australia \nA: SELECT Notes FROM 1-1000181-1 WHERE Current slogan = 'SOUTH AUSTRALIA'"}
RT,虽然书薄了点,但是难度还是有的。
QAQ——–