report-review

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

README.md (2053B)


      1 # Prepare Python
      2 ## create venv
      3 ### install uv
      4 `pip install uv`
      5 ### create .venv
      6 `uv venv .venv`
      7 ## activate venv
      8 `source .venv/bin/activate`
      9 if you use windows powershell, use `.\.venv\Scripts\activate.ps1`
     10 
     11 ## install requirements
     12 `uv pip install -r requirements.txt`
     13 
     14 ## setting for cuda
     15 please make sure you have cuda installed and set the environment variable CUDA_HOME to the path of your cuda installation.
     16 check for it can do with `nvcc --version`
     17 and install pytorch for your cuda version.
     18 for example nvcc version is 13.0
     19 `uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130 --reinstall`
     20 And then, check this python env can use cuda with `python gpu_check.py`
     21 
     22 ## set API key for gemini(only need to use structuring-training-data)
     23 `export GEMINI_API_KEY=your_api_key`
     24 if you use windows powershell, use `$env:GEMINI_API_KEY="あなたのAPIキー"`
     25 
     26 # Prepare Feedback
     27 you only need to use `python structuring-training-data.py`
     28 
     29 # integrate data
     30 integrate feedback and report's typst
     31 use `integrate_data.py`
     32 
     33 # training model
     34 use `train.py`
     35 it may cost many time.
     36 My RTX 3060 spend 10min.
     37 
     38 # convert model to gguf
     39 ```
     40 python vendor/llama.cpp/convert_hf_to_gguf.py mistral_typst_merged --outfile mistral_typst_merged.f16.gguf --outtype f16
     41 ```
     42 # quantize model
     43 ```
     44 python quantize_gguf.py mistral_typst_merged.f16.gguf mistral_typst_merged.q4_0.gguf --quantize-fn q4_0
     45 ```
     46 なおこのプログラムにはllama.cppのビルド済みバイナリが配置されているので動作している.
     47 必要に応じて最新のビルド済みバイナリに更新したり,自分でビルドしてください.
     48 
     49 # サーバーの起動
     50 ```
     51 uvicorn api_server:app --host 0.0.0.0 --port 8080
     52 ```
     53 サーバーがcudaを使わないときは,これを参考にしましたが,治りません.dll地獄です.
     54 https://zenn.dev/hellohazime/articles/ccd01c2df0b5c3
     55 
     56 # レポートのレビュー
     57 use `review_typst.py`
     58 it may cost many time.