diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/qbench.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/qbench.sh new file mode 100644 index 0000000000000000000000000000000000000000..46b8e029bbb02ccaf8cae1a7025867553fbd6c6c --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/qbench.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [ "$1" = "dev" ]; then + echo "Evaluating in 'dev' split." +elif [ "$1" = "test" ]; then + echo "Evaluating in 'test' split." +else + echo "Unknown split, please choose between 'dev' and 'test'." + exit 1 +fi + +python -m llava.eval.model_vqa_qbench \ + --model-path liuhaotian/llava-v1.5-13b \ + --image-folder ./playground/data/eval/qbench/images_llvisionqa/ \ + --questions-file ./playground/data/eval/qbench/llvisionqa_$1.json \ + --answers-file ./playground/data/eval/qbench/llvisionqa_$1_answers.jsonl \ + --conv-mode llava_v1 \ + --lang en diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/qbench_zh.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/qbench_zh.sh new file mode 100644 index 0000000000000000000000000000000000000000..7bfc17088cda577b6f25ec09b20ee8cb2664fec8 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/qbench_zh.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +if [ "$1" = "dev" ]; then + ZH_SPLIT="验证集" + echo "Evaluating in 'dev' split." +elif [ "$1" = "test" ]; then + ZH_SPLIT="测试集" + echo "Evaluating in 'test' split." +else + echo "Unknown split, please choose between 'dev' and 'test'." + exit 1 +fi + +python -m llava.eval.model_vqa_qbench \ + --model-path liuhaotian/llava-v1.5-13b \ + --image-folder ./playground/data/eval/qbench/images_llvisionqa/ \ + --questions-file ./playground/data/eval/qbench/质衡-问答-$ZH_SPLIT.json \ + --answers-file ./playground/data/eval/qbench/llvisionqa_zh_$1_answers.jsonl \ + --conv-mode llava_v1 \ + --lang zh diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/seed.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/seed.sh new file mode 100644 index 0000000000000000000000000000000000000000..565e54d1d4d35791d5ed22ad4e60c43fbdd877ed --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/seed.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +gpu_list="${CUDA_VISIBLE_DEVICES:-0}" +IFS=',' read -ra GPULIST <<< "$gpu_list" + +CHUNKS=${#GPULIST[@]} + +CKPT="llava-v1.5-13b" + +for IDX in $(seq 0 $((CHUNKS-1))); do + CUDA_VISIBLE_DEVICES=${GPULIST[$IDX]} python -m llava.eval.model_vqa_loader \ + --model-path liuhaotian/llava-v1.5-13b \ + --question-file ./playground/data/eval/seed_bench/llava-seed-bench.jsonl \ + --image-folder ./playground/data/eval/seed_bench \ + --answers-file ./playground/data/eval/seed_bench/answers/$CKPT/${CHUNKS}_${IDX}.jsonl \ + --num-chunks $CHUNKS \ + --chunk-idx $IDX \ + --temperature 0 \ + --conv-mode vicuna_v1 & +done + +wait + +output_file=./playground/data/eval/seed_bench/answers/$CKPT/merge.jsonl + +# Clear out the output file if it exists. +> "$output_file" + +# Loop through the indices and concatenate each file. +for IDX in $(seq 0 $((CHUNKS-1))); do + cat ./playground/data/eval/seed_bench/answers/$CKPT/${CHUNKS}_${IDX}.jsonl >> "$output_file" +done + +# Evaluate +python scripts/convert_seed_for_submission.py \ + --annotation-file ./playground/data/eval/seed_bench/SEED-Bench.json \ + --result-file $output_file \ + --result-upload-file ./playground/data/eval/seed_bench/answers_upload/llava-v1.5-13b.jsonl + diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/sqa.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/sqa.sh new file mode 100644 index 0000000000000000000000000000000000000000..8c82dbc256bd610c5ef2564ed2449b6a91857968 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/sqa.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +python -m llava.eval.model_vqa_science \ + --model-path liuhaotian/llava-v1.5-13b \ + --question-file ./playground/data/eval/scienceqa/llava_test_CQM-A.json \ + --image-folder ./playground/data/eval/scienceqa/images/test \ + --answers-file ./playground/data/eval/scienceqa/answers/llava-v1.5-13b.jsonl \ + --single-pred-prompt \ + --temperature 0 \ + --conv-mode vicuna_v1 + +python llava/eval/eval_science_qa.py \ + --base-dir ./playground/data/eval/scienceqa \ + --result-file ./playground/data/eval/scienceqa/answers/llava-v1.5-13b.jsonl \ + --output-file ./playground/data/eval/scienceqa/answers/llava-v1.5-13b_output.jsonl \ + --output-result ./playground/data/eval/scienceqa/answers/llava-v1.5-13b_result.json diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/textvqa.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/textvqa.sh new file mode 100644 index 0000000000000000000000000000000000000000..12311c3ccc3511446298c8e829216266e702ec16 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/textvqa.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +python -m llava.eval.model_vqa_loader \ + --model-path liuhaotian/llava-v1.5-13b \ + --question-file ./playground/data/eval/textvqa/llava_textvqa_val_v051_ocr.jsonl \ + --image-folder ./playground/data/eval/textvqa/train_images \ + --answers-file ./playground/data/eval/textvqa/answers/llava-v1.5-13b.jsonl \ + --temperature 0 \ + --conv-mode vicuna_v1 + +python -m llava.eval.eval_textvqa \ + --annotation-file ./playground/data/eval/textvqa/TextVQA_0.5.1_val.json \ + --result-file ./playground/data/eval/textvqa/answers/llava-v1.5-13b.jsonl diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/vizwiz.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/vizwiz.sh new file mode 100644 index 0000000000000000000000000000000000000000..16cf35ce1b77834d9d8888d53e6cd0f7c2c4ccc6 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/vizwiz.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +python -m llava.eval.model_vqa_loader \ + --model-path liuhaotian/llava-v1.5-13b \ + --question-file ./playground/data/eval/vizwiz/llava_test.jsonl \ + --image-folder ./playground/data/eval/vizwiz/test \ + --answers-file ./playground/data/eval/vizwiz/answers/llava-v1.5-13b.jsonl \ + --temperature 0 \ + --conv-mode vicuna_v1 + +python scripts/convert_vizwiz_for_submission.py \ + --annotation-file ./playground/data/eval/vizwiz/llava_test.jsonl \ + --result-file ./playground/data/eval/vizwiz/answers/llava-v1.5-13b.jsonl \ + --result-upload-file ./playground/data/eval/vizwiz/answers_upload/llava-v1.5-13b.json diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/vqav2.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/vqav2.sh new file mode 100644 index 0000000000000000000000000000000000000000..696efe53340f4abe5ad3ba8b9578df056e6c897d --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/eval/vqav2.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +gpu_list="${CUDA_VISIBLE_DEVICES:-0}" +IFS=',' read -ra GPULIST <<< "$gpu_list" + +CHUNKS=${#GPULIST[@]} + +CKPT="llava-v1.5-13b" +SPLIT="llava_vqav2_mscoco_test-dev2015" + +for IDX in $(seq 0 $((CHUNKS-1))); do + CUDA_VISIBLE_DEVICES=${GPULIST[$IDX]} python -m llava.eval.model_vqa_loader \ + --model-path liuhaotian/llava-v1.5-13b \ + --question-file ./playground/data/eval/vqav2/$SPLIT.jsonl \ + --image-folder ./playground/data/eval/vqav2/test2015 \ + --answers-file ./playground/data/eval/vqav2/answers/$SPLIT/$CKPT/${CHUNKS}_${IDX}.jsonl \ + --num-chunks $CHUNKS \ + --chunk-idx $IDX \ + --temperature 0 \ + --conv-mode vicuna_v1 & +done + +wait + +output_file=./playground/data/eval/vqav2/answers/$SPLIT/$CKPT/merge.jsonl + +# Clear out the output file if it exists. +> "$output_file" + +# Loop through the indices and concatenate each file. +for IDX in $(seq 0 $((CHUNKS-1))); do + cat ./playground/data/eval/vqav2/answers/$SPLIT/$CKPT/${CHUNKS}_${IDX}.jsonl >> "$output_file" +done + +python scripts/convert_vqav2_for_submission.py --split $SPLIT --ckpt $CKPT + diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune.sh new file mode 100644 index 0000000000000000000000000000000000000000..435448394dfcef578ac478f499160fba4ceacd6c --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +deepspeed llava/train/train_mem.py \ + --deepspeed ./scripts/zero3.json \ + --model_name_or_path lmsys/vicuna-13b-v1.5 \ + --version v1 \ + --data_path ./playground/data/llava_v1_5_mix665k.json \ + --image_folder ./playground/data \ + --vision_tower openai/clip-vit-large-patch14-336 \ + --pretrain_mm_mlp_adapter ./checkpoints/llava-v1.5-13b-pretrain/mm_projector.bin \ + --mm_projector_type mlp2x_gelu \ + --mm_vision_select_layer -2 \ + --mm_use_im_start_end False \ + --mm_use_im_patch_token False \ + --image_aspect_ratio pad \ + --group_by_modality_length True \ + --bf16 True \ + --output_dir ./checkpoints/llava-v1.5-13b \ + --num_train_epochs 1 \ + --per_device_train_batch_size 16 \ + --per_device_eval_batch_size 4 \ + --gradient_accumulation_steps 1 \ + --evaluation_strategy "no" \ + --save_strategy "steps" \ + --save_steps 50000 \ + --save_total_limit 1 \ + --learning_rate 2e-5 \ + --weight_decay 0. \ + --warmup_ratio 0.03 \ + --lr_scheduler_type "cosine" \ + --logging_steps 1 \ + --tf32 True \ + --model_max_length 2048 \ + --gradient_checkpointing True \ + --dataloader_num_workers 4 \ + --lazy_preprocess True \ + --report_to wandb diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune_lora.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune_lora.sh new file mode 100644 index 0000000000000000000000000000000000000000..90f00707cf9c9ae499184f0135f7cc9d84327a21 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune_lora.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +deepspeed llava/train/train_mem.py \ + --lora_enable True --lora_r 128 --lora_alpha 256 --mm_projector_lr 2e-5 \ + --deepspeed ./scripts/zero3.json \ + --model_name_or_path lmsys/vicuna-13b-v1.5 \ + --version v1 \ + --data_path ./playground/data/llava_v1_5_mix665k.json \ + --image_folder ./playground/data \ + --vision_tower openai/clip-vit-large-patch14-336 \ + --pretrain_mm_mlp_adapter ./checkpoints/llava-v1.5-13b-pretrain/mm_projector.bin \ + --mm_projector_type mlp2x_gelu \ + --mm_vision_select_layer -2 \ + --mm_use_im_start_end False \ + --mm_use_im_patch_token False \ + --image_aspect_ratio pad \ + --group_by_modality_length True \ + --bf16 True \ + --output_dir ./checkpoints/llava-v1.5-13b-lora \ + --num_train_epochs 1 \ + --per_device_train_batch_size 16 \ + --per_device_eval_batch_size 4 \ + --gradient_accumulation_steps 1 \ + --evaluation_strategy "no" \ + --save_strategy "steps" \ + --save_steps 50000 \ + --save_total_limit 1 \ + --learning_rate 2e-4 \ + --weight_decay 0. \ + --warmup_ratio 0.03 \ + --lr_scheduler_type "cosine" \ + --logging_steps 1 \ + --tf32 True \ + --model_max_length 2048 \ + --gradient_checkpointing True \ + --dataloader_num_workers 4 \ + --lazy_preprocess True \ + --report_to wandb diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune_task.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune_task.sh new file mode 100644 index 0000000000000000000000000000000000000000..063f3f13e119fdb7f6af358f50315e022f15f578 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune_task.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +deepspeed llava/train/train_mem.py \ + --deepspeed ./scripts/zero3.json \ + --model_name_or_path liuhaotian/llava-v1.5-13b \ + --version v1 \ + --data_path ./playground/data/llava_v1_5_mix665k.json \ + --image_folder ./playground/data \ + --vision_tower openai/clip-vit-large-patch14-336 \ + --mm_projector_type mlp2x_gelu \ + --mm_vision_select_layer -2 \ + --mm_use_im_start_end False \ + --mm_use_im_patch_token False \ + --image_aspect_ratio pad \ + --group_by_modality_length True \ + --bf16 True \ + --output_dir ./checkpoints/llava-v1.5-13b-task \ + --num_train_epochs 1 \ + --per_device_train_batch_size 16 \ + --per_device_eval_batch_size 4 \ + --gradient_accumulation_steps 1 \ + --evaluation_strategy "no" \ + --save_strategy "steps" \ + --save_steps 50000 \ + --save_total_limit 1 \ + --learning_rate 2e-5 \ + --weight_decay 0. \ + --warmup_ratio 0.03 \ + --lr_scheduler_type "cosine" \ + --logging_steps 1 \ + --tf32 True \ + --model_max_length 2048 \ + --gradient_checkpointing True \ + --dataloader_num_workers 4 \ + --lazy_preprocess True \ + --report_to wandb diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune_task_lora.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune_task_lora.sh new file mode 100644 index 0000000000000000000000000000000000000000..f11303f299aeb675e23b0cb37ff4c881aec6f99e --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/finetune_task_lora.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +deepspeed llava/train/train_mem.py \ + --lora_enable True --lora_r 128 --lora_alpha 256 --mm_projector_lr 2e-5 \ + --deepspeed ./scripts/zero3.json \ + --model_name_or_path liuhaotian/llava-v1.5-13b \ + --version v1 \ + --data_path ./playground/data/llava_v1_5_mix665k.json \ + --image_folder ./playground/data \ + --vision_tower openai/clip-vit-large-patch14-336 \ + --mm_projector_type mlp2x_gelu \ + --mm_vision_select_layer -2 \ + --mm_use_im_start_end False \ + --mm_use_im_patch_token False \ + --image_aspect_ratio pad \ + --group_by_modality_length True \ + --bf16 True \ + --output_dir ./checkpoints/llava-v1.5-13b-task-lora \ + --num_train_epochs 1 \ + --per_device_train_batch_size 16 \ + --per_device_eval_batch_size 4 \ + --gradient_accumulation_steps 1 \ + --evaluation_strategy "no" \ + --save_strategy "steps" \ + --save_steps 50000 \ + --save_total_limit 1 \ + --learning_rate 2e-4 \ + --weight_decay 0. \ + --warmup_ratio 0.03 \ + --lr_scheduler_type "cosine" \ + --logging_steps 1 \ + --tf32 True \ + --model_max_length 2048 \ + --gradient_checkpointing True \ + --dataloader_num_workers 4 \ + --lazy_preprocess True \ + --report_to wandb diff --git a/fin-mm/code/LLaVA-Plus/scripts/v1_5/pretrain.sh b/fin-mm/code/LLaVA-Plus/scripts/v1_5/pretrain.sh new file mode 100644 index 0000000000000000000000000000000000000000..9316eaa309ea8c12d9612a01d85958550357b9a7 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/v1_5/pretrain.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +deepspeed llava/train/train_mem.py \ + --deepspeed ./scripts/zero2.json \ + --model_name_or_path lmsys/vicuna-13b-v1.5 \ + --version plain \ + --data_path ./playground/data/LLaVA-Pretrain/blip_laion_cc_sbu_558k.json \ + --image_folder ./playground/data/LLaVA-Pretrain/images \ + --vision_tower openai/clip-vit-large-patch14-336 \ + --mm_projector_type mlp2x_gelu \ + --tune_mm_mlp_adapter True \ + --mm_vision_select_layer -2 \ + --mm_use_im_start_end False \ + --mm_use_im_patch_token False \ + --bf16 True \ + --output_dir ./checkpoints/llava-v1.5-13b-pretrain \ + --num_train_epochs 1 \ + --per_device_train_batch_size 32 \ + --per_device_eval_batch_size 4 \ + --gradient_accumulation_steps 1 \ + --evaluation_strategy "no" \ + --save_strategy "steps" \ + --save_steps 24000 \ + --save_total_limit 1 \ + --learning_rate 1e-3 \ + --weight_decay 0. \ + --warmup_ratio 0.03 \ + --lr_scheduler_type "cosine" \ + --logging_steps 1 \ + --tf32 True \ + --model_max_length 2048 \ + --gradient_checkpointing True \ + --dataloader_num_workers 4 \ + --lazy_preprocess True \ + --report_to wandb diff --git a/fin-mm/code/LLaVA-Plus/scripts/zero2.json b/fin-mm/code/LLaVA-Plus/scripts/zero2.json new file mode 100644 index 0000000000000000000000000000000000000000..c95ebefe07b7d8d9fd0936a014679d07102cc270 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/zero2.json @@ -0,0 +1,23 @@ +{ + "fp16": { + "enabled": "auto", + "loss_scale": 0, + "loss_scale_window": 1000, + "initial_scale_power": 16, + "hysteresis": 2, + "min_loss_scale": 1 + }, + "bf16": { + "enabled": "auto" + }, + "train_micro_batch_size_per_gpu": "auto", + "train_batch_size": "auto", + "gradient_accumulation_steps": "auto", + "zero_optimization": { + "stage": 2, + "overlap_comm": true, + "contiguous_gradients": true, + "sub_group_size": 1e9, + "reduce_bucket_size": "auto" + } +} \ No newline at end of file diff --git a/fin-mm/code/LLaVA-Plus/scripts/zero3.json b/fin-mm/code/LLaVA-Plus/scripts/zero3.json new file mode 100644 index 0000000000000000000000000000000000000000..6917317af62da757ca759a92b326ddfa65b203cc --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/zero3.json @@ -0,0 +1,28 @@ +{ + "fp16": { + "enabled": "auto", + "loss_scale": 0, + "loss_scale_window": 1000, + "initial_scale_power": 16, + "hysteresis": 2, + "min_loss_scale": 1 + }, + "bf16": { + "enabled": "auto" + }, + "train_micro_batch_size_per_gpu": "auto", + "train_batch_size": "auto", + "gradient_accumulation_steps": "auto", + "zero_optimization": { + "stage": 3, + "overlap_comm": true, + "contiguous_gradients": true, + "sub_group_size": 1e9, + "reduce_bucket_size": "auto", + "stage3_prefetch_bucket_size": "auto", + "stage3_param_persistence_threshold": "auto", + "stage3_max_live_parameters": 1e9, + "stage3_max_reuse_distance": 1e9, + "stage3_gather_16bit_weights_on_model_save": true + } +} \ No newline at end of file diff --git a/fin-mm/code/LLaVA-Plus/scripts/zero3_offload.json b/fin-mm/code/LLaVA-Plus/scripts/zero3_offload.json new file mode 100644 index 0000000000000000000000000000000000000000..e0a54c2c2bc10f76458c42a43de0970a9251759f --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/scripts/zero3_offload.json @@ -0,0 +1,56 @@ +{ + "fp16": { + "enabled": "auto", + "loss_scale": 0, + "loss_scale_window": 1000, + "initial_scale_power": 16, + "hysteresis": 2, + "min_loss_scale": 1 + }, + "bf16": { + "enabled": "auto" + }, + "optimizer": { + "type": "AdamW", + "params": { + "lr": "auto", + "betas": "auto", + "eps": "auto", + "weight_decay": "auto" + } + }, + "scheduler": { + "type": "WarmupLR", + "params": { + "warmup_min_lr": "auto", + "warmup_max_lr": "auto", + "warmup_num_steps": "auto" + } + }, + "zero_optimization": { + "stage": 3, + "offload_optimizer": { + "device": "cpu", + "pin_memory": true + }, + "offload_param": { + "device": "cpu", + "pin_memory": true + }, + "overlap_comm": true, + "contiguous_gradients": true, + "sub_group_size": 1e9, + "reduce_bucket_size": "auto", + "stage3_prefetch_bucket_size": "auto", + "stage3_param_persistence_threshold": "auto", + "stage3_max_live_parameters": 1e9, + "stage3_max_reuse_distance": 1e9, + "gather_16bit_weights_on_model_save": true + }, + "gradient_accumulation_steps": "auto", + "gradient_clipping": "auto", + "train_batch_size": "auto", + "train_micro_batch_size_per_gpu": "auto", + "steps_per_print": 1e5, + "wall_clock_breakdown": false +} \ No newline at end of file diff --git a/fin-mm/code/LLaVA-Plus/serve/__init__.py b/fin-mm/code/LLaVA-Plus/serve/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/fin-mm/code/LLaVA-Plus/serve/blip2_test_message.py b/fin-mm/code/LLaVA-Plus/serve/blip2_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..62752e15e2d5e52350ff7ad7e4802b8ed04285c7 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/blip2_test_message.py @@ -0,0 +1,108 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "GSAM Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + datas = { + "model": model_name, + "image": img_arg, + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='blip2') + + # model parameters + parser.add_argument( + "--image_path", type=str, default="assets/demo2.jpg" + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/blip2_worker.py b/fin-mm/code/LLaVA-Plus/serve/blip2_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..c3e81fb73af70753bf74dd50a528ac998bc854bd --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/blip2_worker.py @@ -0,0 +1,369 @@ +""" +A model worker executes the model. +""" + +import uvicorn +import torch.nn.functional as F +import torch +from transformers import AutoProcessor, Blip2ForConditionalGeneration +from PIL import Image +import requests +import numpy as np +from fastapi.responses import StreamingResponse, JSONResponse +from fastapi import FastAPI, Request, BackgroundTasks +import base64 +from io import BytesIO +import uuid +import threading +from typing import List, Tuple, Union +import time +import sys +import os +import json +import logging +import dataclasses +import asyncio +import argparse +import sys +import os +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + + +from serve.utils import build_logger, pretty_print_semaphore +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG + +try: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LlamaTokenizer, + AutoModel, + ) +except ImportError: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LLaMATokenizer, + AutoModel, + ) + + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + model_path, + model_names, + device, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + if model_path.endswith("/"): + model_path = model_path[:-1] + self.model_names = model_names or [model_path.split("/")[-1]] + self.device = device + + # load model + logger.info( + f"Loading the model {self.model_names} on worker {worker_id} ...") + self.processor = AutoProcessor.from_pretrained(model_path) + self.model = Blip2ForConditionalGeneration.from_pretrained( + model_path, torch_dtype=torch.float16) + self.model.eval() + self.model.to(device) + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def load_image(self, image_path: str) -> Tuple[np.array, torch.Tensor]: + + if os.path.exists(image_path): + image_source = Image.open(image_path).convert("RGB") + else: + # base64 coding + image_source = Image.open( + BytesIO(base64.b64decode(image_path))).convert("RGB") + + return image_source + + def generate_stream_func(self, model, params, device): + # get inputs + image_path = params["image"] + + # load image and run models + image = self.load_image(image_path) + + # caption: + inputs = self.processor(image, return_tensors="pt").to( + device, torch.float16) + generated_ids = model.generate(**inputs, max_new_tokens=20) + generated_text = self.processor.batch_decode( + generated_ids, skip_special_tokens=True)[0].strip() + + w, h = image.size + pred_dict = { + "caption": generated_text, + "size": [h, w], # H,W + } + + return pred_dict + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + self.model, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + @torch.inference_mode() + def get_embeddings(self, params): + try: + tokenizer = self.tokenizer + is_llama = "llama" in str( + type(self.model) + ) # vicuna support batch inference + is_chatglm = "chatglm" in str(type(self.model)) + is_t5 = "t5" in str(type(self.model)) + if is_llama: + encoding = tokenizer.batch_encode_plus( + params["input"], padding=True, return_tensors="pt" + ) + input_ids = encoding["input_ids"].to(self.device) + attention_mask = encoding["attention_mask"].to(self.device) + model_output = self.model( + input_ids, attention_mask, output_hidden_states=True + ) + data = model_output.hidden_states[-1] + mask = attention_mask.unsqueeze(-1).expand(data.size()).float() + masked_embeddings = data * mask + sum_embeddings = torch.sum(masked_embeddings, dim=1) + seq_length = torch.sum(mask, dim=1) + embedding = sum_embeddings / seq_length + normalized_embeddings = F.normalize(embedding, p=2, dim=1) + ret = { + "embedding": normalized_embeddings.tolist(), + "token_num": torch.sum(attention_mask).item(), + } + else: + embedding = [] + token_num = 0 + for text in params["input"]: + input_ids = tokenizer.encode(text, return_tensors="pt").to( + self.device + ) + if is_t5: + model_output = self.model( + input_ids, decoder_input_ids=input_ids + ) + else: + model_output = self.model( + input_ids, output_hidden_states=True) + if is_chatglm: + data = ( + model_output.hidden_states[-1].transpose(0, 1))[0] + elif is_t5: + data = model_output.encoder_last_hidden_state[0] + else: + data = model_output.hidden_states[-1][0] + data = F.normalize(torch.mean(data, dim=0), p=2, dim=0) + embedding.append(data.tolist()) + token_num += len(input_ids[0]) + ret = { + "embedding": embedding, + "token_num": token_num, + } + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21006) + parser.add_argument("--worker-address", type=str, + default="http://localhost:21006") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-path", type=str, default="Salesforce/blip2-opt-2.7b" + ) + + parser.add_argument( + "--model-names", + default="blip2", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.model_path, + args.model_names, + args.device, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/blip2grounding_test_message.py b/fin-mm/code/LLaVA-Plus/serve/blip2grounding_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..6ca06ce7bda8f3bbcc2dace892442cc457638750 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/blip2grounding_test_message.py @@ -0,0 +1,124 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +from groundingdino.util.inference import annotate +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "GSAM Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + datas = { + "model": model_name, + "image": img_arg, + "box_threshold": args.box_threshold, + "text_threshold": args.text_threshold, + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + + # visualize + res = response.json() + boxes = torch.Tensor(res["boxes"]) + logits = torch.Tensor(res["logits"]) + phrases = res["phrases"] + image_source = np.array(Image.open(args.image_path).convert("RGB")) + annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) + cv2.imwrite("annotated_image.jpg", annotated_frame) + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='blip2+grounding_dino') + + # model parameters + parser.add_argument( + "--image_path", type=str, default="/home/liushilong/code/GroundingFolder/Grounded-Segment-Anything/assets/demo2.jpg" + ) + parser.add_argument( + "--box_threshold", type=float, default=0.3, + ) + parser.add_argument( + "--text_threshold", type=float, default=0.25, + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/blip2grounding_worker.py b/fin-mm/code/LLaVA-Plus/serve/blip2grounding_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..2ec82f5c083d99143753333f21be4ebb88525fea --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/blip2grounding_worker.py @@ -0,0 +1,345 @@ +""" +A model worker executes the model. +""" +import sys, os +from groundingdino.util import box_ops + +from segment_anything import build_sam +from segment_anything.predictor import SamPredictor +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid + +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +from demo.inference_on_a_image import get_grounding_output + +from groundingdino.util.inference import load_model, predict +import groundingdino.datasets.transforms as T +import pycocotools.mask as mask_util + + +try: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LlamaTokenizer, + AutoModel, + ) +except ImportError: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LLaMATokenizer, + AutoModel, + ) +import torch +import torch.nn.functional as F +import uvicorn + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + grounding_dino_server, + blip2_server, + model_names, + device, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + self.model_names = model_names + self.device = device + + self.grounding_dino_server = grounding_dino_server + self.grounding_dino_server_addr = self.get_sub_worker_addr(grounding_dino_server) + print(f"grounding_dino_server_addr: {self.grounding_dino_server_addr}") + + self.blip2_server = blip2_server + self.blip2_server_addr = self.get_sub_worker_addr(blip2_server) + print(f"blip2_server_addr: {self.blip2_server_addr}") + + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + + def get_sub_worker_addr(self, worker_name): + # get grounding dino addr + if worker_name.startswith("http"): + sub_server_addr = worker_name + else: + controller_addr = self.controller_addr + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": worker_name} + ) + sub_server_addr = ret.json()["address"] + # print(f"worker_name: {worker_name}") + return sub_server_addr + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def load_image(self, image_path: str) -> Tuple[np.array, torch.Tensor]: + + + if os.path.exists(image_path): + image_source = Image.open(image_path).convert("RGB") + else: + # base64 coding + image_source = Image.open(BytesIO(base64.b64decode(image_path))).convert("RGB") + + image = np.asarray(image_source) + image_transformed, _ = self.transform(image_source, None) + return image, image_transformed + + def generate_stream_func(self, model, params, device): + # get inputs + + + + headers = {"User-Agent": "G-SAM Client"} + + # blip2 + pred_dict_blip2 = requests.post( + self.blip2_server_addr + "/worker_generate", + headers=headers, + json=params, + ).json() + + params.update({ + "caption": pred_dict_blip2["caption"], + }) + + # gdino + pred_dict_gdino = requests.post( + self.grounding_dino_server_addr + "/worker_generate", + headers=headers, + json=params, + ).json() + + pred_dict_gdino.update({ + "caption": pred_dict_blip2["caption"], + }) + + return pred_dict_gdino + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + None, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21078) + parser.add_argument("--worker-address", type=str, default="http://localhost:21078") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--grounding-dino-server", type=str, default="grounding_dino" + ) + parser.add_argument( + "--blip2-server", type=str, default="blip2" + ) + parser.add_argument( + "--model-names", + default="blip2+grounding_dino", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.grounding_dino_server, + args.blip2_server, + args.model_names, + args.device, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/clip_retrieval_test_message.py b/fin-mm/code/LLaVA-Plus/serve/clip_retrieval_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..b0c396d39b61e658f140badab1c63335e33e25bc --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/clip_retrieval_test_message.py @@ -0,0 +1,125 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +from groundingdino.util.inference import annotate +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "GSAM Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + datas = { + "model": model_name, + "image": img_arg, + "box_threshold": args.box_threshold, + "text_threshold": args.text_threshold, + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + # import ipdb; ipdb.set_trace() + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + + # # visualize + # res = response.json() + # boxes = torch.Tensor(res["boxes"]) + # logits = torch.Tensor(res["logits"]) + # phrases = res["phrases"] + # image_source = np.array(Image.open(args.image_path).convert("RGB")) + # annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) + # cv2.imwrite("annotated_image.jpg", annotated_frame) + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='clip') + + # model parameters + parser.add_argument( + "--image_path", type=str, default="assets/demo2.jpg" + ) + parser.add_argument( + "--box_threshold", type=float, default=0.3, + ) + parser.add_argument( + "--text_threshold", type=float, default=0.25, + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/clip_retrieval_worker.py b/fin-mm/code/LLaVA-Plus/serve/clip_retrieval_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..0b3fa39d107a7fe19d52b769a6f8ce1d7b176099 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/clip_retrieval_worker.py @@ -0,0 +1,384 @@ +""" +A model worker executes the model. +Using +""" +import sys, os +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid + +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +from clip_retrieval.clip_client import ClipClient, Modality + + +import torch +import torch.nn.functional as F +import uvicorn +import clip # pylint: disable=import-outside-toplevel + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +from PIL import Image as pimage + + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + model_path, + model_names, + device, + indice_name, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + self.model_names = model_names + self.device = device + + # load clip + logger.info(f"Loading clip ...") + self.model, self.preprocess = clip.load("ViT-L/14", device=device, jit=True) + + + # load model + logger.info(f"Loading client ...") + self.client = ClipClient( + url="https://knn.laion.ai/knn-service", + indice_name=indice_name, + aesthetic_score=9, + aesthetic_weight=0.5, + modality=Modality.IMAGE, + num_images=20, + ) + + if indice_name == "laion5B-H-14": + os.environ['SEND_IMAGE'] = "True" + print("Set SEND_IMAGE to True, since indice_name is laion5B-H-14") + print("SEND_IMAGE", os.getenv("SEND_IMAGE", False)) + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + def normalized(self, a, axis=-1, order=2): + l2 = np.atleast_1d(np.linalg.norm(a, order, axis)) + l2[l2 == 0] = 1 + return a / np.expand_dims(l2, axis) + + def get_text_emb(self, text): + with torch.no_grad(): + text_emb = self.model.encode_text(clip.tokenize([text], truncate=True).to(self.device)) + text_emb /= text_emb.norm(dim=-1, keepdim=True) + text_emb = text_emb.cpu().detach().numpy().astype("float32")[0] + return text_emb + + + def get_image_emb(self, image): + with torch.no_grad(): + image_emb = self.model.encode_image(self.preprocess(image).unsqueeze(0).to(self.device)) + image_emb /= image_emb.norm(dim=-1, keepdim=True) + image_emb = image_emb.cpu().detach().numpy().astype("float32")[0] + return image_emb + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def load_image(self, image_path: str) -> Image.Image: + + if os.path.exists(image_path): + image_source = Image.open(image_path).convert("RGB") + else: + # base64 coding + image_source = Image.open(BytesIO(base64.b64decode(image_path))).convert("RGB") + + return image_source + + def generate_stream_func(self, model, params, device): + # get inputs + image_path = params["image"] + # load image and run models + image = self.load_image(image_path) + + + if not os.getenv("SEND_IMAGE", False): + + + # embedding + tic = time.time() + image_emb = self.get_image_emb(image) + embed_time = time.time() - tic + + # search + tic = time.time() + beach_results = self.client.query(embedding_input=image_emb.tolist()) + query_time = time.time() - tic + + print("embed_time", embed_time, "query_time", query_time) + print(beach_results) + else: + # save image + save_name = "test.jpg" + image.save(save_name) + beach_results = self.client.query(image=save_name) + + + w, h = image.size + pred_dict = { + "retrieval_results": beach_results, + "size": [h, w], # H,W + } + + return pred_dict + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + None, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + + +# app = FastAPI() + + +# def release_model_semaphore(): +# model_semaphore.release() + + +# def acquire_model_semaphore(): +# global model_semaphore, global_counter +# global_counter += 1 +# if model_semaphore is None: +# model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) +# return model_semaphore.acquire() + + +# def create_background_tasks(): +# background_tasks = BackgroundTasks() +# background_tasks.add_task(release_model_semaphore) +# return background_tasks + + + +# @app.post("/worker_generate") +# async def api_generate(request: Request): +# params = await request.json() +# await acquire_model_semaphore() +# output = worker.generate_gate(params) +# release_model_semaphore() +# return JSONResponse(output) + + +# @app.post("/worker_get_status") +# async def api_get_status(request: Request): +# return worker.get_status() + + + + + +# @app.post("/model_details") +# async def model_details(request: Request): +# return {"context_length": worker.context_len} + + +if __name__ == "__main__": + app = FastAPI() + def release_model_semaphore(): + model_semaphore.release() + + def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + @app.post("/worker_generate") + async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + @app.post("/worker_get_status") + async def api_get_status(request: Request): + return worker.get_status() + + @app.post("/model_details") + async def model_details(request: Request): + return {"context_length": worker.context_len} + + + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21046) + parser.add_argument("--worker-address", type=str, default="http://localhost:21046") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-path", type=str, default="Salesforce/blip2-opt-2.7b" + ) + + parser.add_argument( + "--model-names", + default="retrieval,clip", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + + parser.add_argument( + "--indice_name", + type=str, + default="laion5B-H-14", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.model_path, + args.model_names, + args.device, + args.indice_name, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/constants.py b/fin-mm/code/LLaVA-Plus/serve/constants.py new file mode 100644 index 0000000000000000000000000000000000000000..52109c98e2629ece37f9100421401965a129113d --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/constants.py @@ -0,0 +1,58 @@ +from enum import IntEnum +import os + +REPO_PATH = os.path.dirname(os.path.dirname(__file__)) + +##### For the gradio web server +SERVER_ERROR_MSG = ( + "**NETWORK ERROR DUE TO HIGH TRAFFIC. PLEASE REGENERATE OR REFRESH THIS PAGE.**" +) +MODERATION_MSG = "YOUR INPUT VIOLATES OUR CONTENT MODERATION GUIDELINES. PLEASE FIX YOUR INPUT AND TRY AGAIN." +CONVERSATION_LIMIT_MSG = "YOU HAVE REACHED THE CONVERSATION LENGTH LIMIT. PLEASE CLEAR HISTORY AND START A NEW CONVERSATION." +INACTIVE_MSG = "THIS SESSION HAS BEEN INACTIVE FOR TOO LONG. PLEASE REFRESH THIS PAGE." +# Maximum input length +INPUT_CHAR_LEN_LIMIT = int(os.getenv("FASTCHAT_INPUT_CHAR_LEN_LIMIT", 2560)) +# Maximum conversation turns +CONVERSATION_TURN_LIMIT = 50 +# Session expiration time +SESSION_EXPIRATION_TIME = 3600 +# The output dir of log files +LOGDIR = "." + + +##### For the controller and workers (could be overwritten through ENV variables.) +CONTROLLER_HEART_BEAT_EXPIRATION = int( + os.getenv("FASTCHAT_CONTROLLER_HEART_BEAT_EXPIRATION", 90) +) +WORKER_HEART_BEAT_INTERVAL = int(os.getenv("FASTCHAT_WORKER_HEART_BEAT_INTERVAL", 45)) +WORKER_API_TIMEOUT = int(os.getenv("FASTCHAT_WORKER_API_TIMEOUT", 100)) +WORKER_API_EMBEDDING_BATCH_SIZE = int( + os.getenv("FASTCHAT_WORKER_API_EMBEDDING_BATCH_SIZE", 4) +) + + +class ErrorCode(IntEnum): + """ + https://platform.openai.com/docs/guides/error-codes/api-errors + """ + + VALIDATION_TYPE_ERROR = 40001 + + INVALID_AUTH_KEY = 40101 + INCORRECT_AUTH_KEY = 40102 + NO_PERMISSION = 40103 + + INVALID_MODEL = 40301 + PARAM_OUT_OF_RANGE = 40302 + CONTEXT_OVERFLOW = 40303 + + RATE_LIMIT = 42901 + QUOTA_EXCEEDED = 42902 + ENGINE_OVERLOADED = 42903 + + INTERNAL_ERROR = 50001 + CUDA_OUT_OF_MEMORY = 50002 + GRADIO_REQUEST_ERROR = 50003 + GRADIO_STREAM_UNKNOWN_ERROR = 50004 + CONTROLLER_NO_WORKER = 50005 + CONTROLLER_WORKER_TIMEOUT = 50006 diff --git a/fin-mm/code/LLaVA-Plus/serve/controller.py b/fin-mm/code/LLaVA-Plus/serve/controller.py new file mode 100644 index 0000000000000000000000000000000000000000..158c6e922011eb5dcf43350dc3f916839fefe9f3 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/controller.py @@ -0,0 +1,303 @@ +""" +A controller manages distributed workers. +It sends worker addresses to clients. +""" + +import uvicorn +import requests +import numpy as np +from fastapi.responses import StreamingResponse +from fastapi import FastAPI, Request +import threading +from typing import List, Union +import time +import logging +import json +from enum import Enum, auto +import dataclasses +import asyncio +import argparse +import sys +import os + +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +from serve.utils import build_logger, server_error_msg +from serve.constants import CONTROLLER_HEART_BEAT_EXPIRATION + +logger = build_logger("controller", "controller.log") + + +class DispatchMethod(Enum): + LOTTERY = auto() + SHORTEST_QUEUE = auto() + + @classmethod + def from_str(cls, name): + if name == "lottery": + return cls.LOTTERY + elif name == "shortest_queue": + return cls.SHORTEST_QUEUE + else: + raise ValueError(f"Invalid dispatch method") + + +@dataclasses.dataclass +class WorkerInfo: + model_names: List[str] + speed: int + queue_length: int + check_heart_beat: bool + last_heart_beat: str + + +def heart_beat_controller(controller): + while True: + time.sleep(CONTROLLER_HEART_BEAT_EXPIRATION) + controller.remove_stable_workers_by_expiration() + + +class Controller: + def __init__(self, dispatch_method: str): + # Dict[str -> WorkerInfo] + self.worker_info = {} + self.dispatch_method = DispatchMethod.from_str(dispatch_method) + + self.heart_beat_thread = threading.Thread( + target=heart_beat_controller, args=(self,)) + self.heart_beat_thread.start() + + logger.info("Init controller") + + def register_worker(self, worker_name: str, check_heart_beat: bool, + worker_status: dict): + if worker_name not in self.worker_info: + logger.info(f"Register a new worker: {worker_name}") + else: + logger.info(f"Register an existing worker: {worker_name}") + + if not worker_status: + worker_status = self.get_worker_status(worker_name) + if not worker_status: + return False + + self.worker_info[worker_name] = WorkerInfo( + worker_status["model_names"], worker_status["speed"], worker_status["queue_length"], + check_heart_beat, time.time()) + + logger.info(f"Register done: {worker_name}, {worker_status}") + return True + + def get_worker_status(self, worker_name: str): + try: + r = requests.post(worker_name + "/worker_get_status", timeout=5) + except requests.exceptions.RequestException as e: + logger.error(f"Get status fails: {worker_name}, {e}") + return None + + if r.status_code != 200: + logger.error(f"Get status fails: {worker_name}, {r}") + return None + + return r.json() + + def remove_worker(self, worker_name: str): + del self.worker_info[worker_name] + + def refresh_all_workers(self): + old_info = dict(self.worker_info) + self.worker_info = {} + + for w_name, w_info in old_info.items(): + if not self.register_worker(w_name, w_info.check_heart_beat, None): + logger.info(f"Remove stale worker: {w_name}") + + def list_models(self): + model_names = set() + + for w_name, w_info in self.worker_info.items(): + model_names.update(w_info.model_names) + + return list(model_names) + + def get_worker_address(self, model_name: str): + if self.dispatch_method == DispatchMethod.LOTTERY: + worker_names = [] + worker_speeds = [] + for w_name, w_info in self.worker_info.items(): + if model_name in w_info.model_names: + worker_names.append(w_name) + worker_speeds.append(w_info.speed) + worker_speeds = np.array(worker_speeds, dtype=np.float32) + norm = np.sum(worker_speeds) + if norm < 1e-4: + return "" + worker_speeds = worker_speeds / norm + if True: # Directly return address + pt = np.random.choice(np.arange(len(worker_names)), + p=worker_speeds) + worker_name = worker_names[pt] + return worker_name + + # Check status before returning + while True: + pt = np.random.choice(np.arange(len(worker_names)), + p=worker_speeds) + worker_name = worker_names[pt] + + if self.get_worker_status(worker_name): + break + else: + self.remove_worker(worker_name) + worker_speeds[pt] = 0 + norm = np.sum(worker_speeds) + if norm < 1e-4: + return "" + worker_speeds = worker_speeds / norm + continue + return worker_name + elif self.dispatch_method == DispatchMethod.SHORTEST_QUEUE: + worker_names = [] + worker_qlen = [] + for w_name, w_info in self.worker_info.items(): + if model_name in w_info.model_names: + worker_names.append(w_name) + worker_qlen.append(w_info.queue_length / w_info.speed) + if len(worker_names) == 0: + return "" + min_index = np.argmin(worker_qlen) + w_name = worker_names[min_index] + self.worker_info[w_name].queue_length += 1 + logger.info( + f"names: {worker_names}, queue_lens: {worker_qlen}, ret: {w_name}") + return w_name + else: + raise ValueError( + f"Invalid dispatch method: {self.dispatch_method}") + + def receive_heart_beat(self, worker_name: str, queue_length: int): + if worker_name not in self.worker_info: + logger.info(f"Receive unknown heart beat. {worker_name}") + return False + + self.worker_info[worker_name].queue_length = queue_length + self.worker_info[worker_name].last_heart_beat = time.time() + logger.info(f"Receive heart beat. {worker_name}") + return True + + def remove_stable_workers_by_expiration(self): + expire = time.time() - CONTROLLER_HEART_BEAT_EXPIRATION + to_delete = [] + for worker_name, w_info in self.worker_info.items(): + if w_info.check_heart_beat and w_info.last_heart_beat < expire: + to_delete.append(worker_name) + + for worker_name in to_delete: + self.remove_worker(worker_name) + + def worker_api_generate_stream(self, params): + worker_addr = self.get_worker_address(params["model"]) + if not worker_addr: + logger.info(f"no worker: {params['model']}") + ret = { + "text": server_error_msg, + "error_code": 2, + } + yield json.dumps(ret).encode() + b"\0" + + try: + response = requests.post(worker_addr + "/worker_generate_stream", + json=params, stream=True, timeout=5) + for chunk in response.iter_lines(decode_unicode=False, delimiter=b"\0"): + if chunk: + yield chunk + b"\0" + except requests.exceptions.RequestException as e: + logger.info(f"worker timeout: {worker_addr}") + ret = { + "text": server_error_msg, + "error_code": 3, + } + yield json.dumps(ret).encode() + b"\0" + + # Let the controller act as a worker to achieve hierarchical + # management. This can be used to connect isolated sub networks. + + def worker_api_get_status(self): + model_names = set() + speed = 0 + queue_length = 0 + + for w_name in self.worker_info: + worker_status = self.get_worker_status(w_name) + if worker_status is not None: + model_names.update(worker_status["model_names"]) + speed += worker_status["speed"] + queue_length += worker_status["queue_length"] + + return { + "model_names": list(model_names), + "speed": speed, + "queue_length": queue_length, + } + + +app = FastAPI() + + +@app.post("/register_worker") +async def register_worker(request: Request): + data = await request.json() + controller.register_worker( + data["worker_name"], data["check_heart_beat"], + data.get("worker_status", None)) + + +@app.post("/refresh_all_workers") +async def refresh_all_workers(): + models = controller.refresh_all_workers() + + +@app.post("/list_models") +async def list_models(): + models = controller.list_models() + return {"models": models} + + +@app.post("/get_worker_address") +async def get_worker_address(request: Request): + data = await request.json() + addr = controller.get_worker_address(data["model"]) + return {"address": addr} + + +@app.post("/receive_heart_beat") +async def receive_heart_beat(request: Request): + data = await request.json() + exist = controller.receive_heart_beat( + data["worker_name"], data["queue_length"]) + return {"exist": exist} + + +@app.post("/worker_generate_stream") +async def worker_api_generate_stream(request: Request): + params = await request.json() + generator = controller.worker_api_generate_stream(params) + return StreamingResponse(generator) + + +@app.post("/worker_get_status") +async def worker_api_get_status(request: Request): + return controller.worker_api_get_status() + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21001) + parser.add_argument("--dispatch-method", type=str, choices=[ + "lottery", "shortest_queue"], default="shortest_queue") + args = parser.parse_args() + logger.info(f"args: {args}") + + controller = Controller(args.dispatch_method) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/grounded_sam_test_message.py b/fin-mm/code/LLaVA-Plus/serve/grounded_sam_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..7dc20311b865e49f9e2904f36a79330fc275dbd4 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/grounded_sam_test_message.py @@ -0,0 +1,155 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +from groundingdino.util.inference import annotate, annotate_xyxy +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +import pycocotools.mask as mask_util + + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + +def show_mask(mask, image, random_color=True): + if random_color: + color = np.concatenate([np.random.random(3), np.array([0.8])], axis=0) + else: + color = np.array([30/255, 144/255, 255/255, 0.6]) + h, w = mask.shape[-2:] + mask_image = mask.reshape(h, w, 1) * color.reshape(1, 1, -1) + + annotated_frame_pil = Image.fromarray(image).convert("RGBA") + mask_image_pil = Image.fromarray((mask_image.cpu().numpy() * 255).astype(np.uint8)).convert("RGBA") + + return np.array(Image.alpha_composite(annotated_frame_pil, mask_image_pil)) + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "FastChat Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + img = None + datas = { + "model": model_name, + "caption": args.caption, + "image": img_arg, + "box_threshold": args.box_threshold, + "text_threshold": args.text_threshold, + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + # visualize + res = response.json() + # import ipdb; ipdb.set_trace() + boxes = torch.Tensor(res["boxes"]) + logits = torch.Tensor(res["logits"]) + phrases = res["phrases"] + if img is not None: + image_source = np.array(img.convert("RGB")) + else: + image_source = np.array(Image.open(args.image_path).convert("RGB")) + annotated_frame = annotate_xyxy(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) + # cv2.imwrite("annotated_image.jpg", annotated_frame) + + # show mask + masks_rle = res["masks_rle"] + for mask_rle in masks_rle: + mask = mask_util.decode(mask_rle) + mask = torch.Tensor(mask) + annotated_frame = show_mask(mask, annotated_frame) + cv2.imwrite("annotated_image_mask.jpg", annotated_frame) + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='grounded_sam') + + # model parameters + parser.add_argument( + "--caption", type=str, default="dogs ." + ) + parser.add_argument( + "--image_path", type=str, default="/home/liushilong/code/GroundingFolder/Grounded-Segment-Anything/assets/demo2.jpg" + ) + parser.add_argument( + "--box_threshold", type=float, default=0.3, + ) + parser.add_argument( + "--text_threshold", type=float, default=0.25, + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/grounded_sam_worker.py b/fin-mm/code/LLaVA-Plus/serve/grounded_sam_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..c6362de602124374526b941bdd5dac80c4835ee4 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/grounded_sam_worker.py @@ -0,0 +1,452 @@ +""" +A model worker executes the model. +""" +import sys, os +from groundingdino.util import box_ops + +from segment_anything import build_sam +from segment_anything.predictor import SamPredictor +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid + +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +from demo.inference_on_a_image import get_grounding_output + +from groundingdino.util.inference import load_model, predict +import groundingdino.datasets.transforms as T +import pycocotools.mask as mask_util + + +try: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LlamaTokenizer, + AutoModel, + ) +except ImportError: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LLaMATokenizer, + AutoModel, + ) +import torch +import torch.nn.functional as F +import uvicorn + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + model_path, + model_config, + model_names, + sam_path, + device, + grounding_dino_server=None, + sam_server=None, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + if model_path.endswith("/"): + model_path = model_path[:-1] + self.model_names = model_names + self.model_config = model_config + self.device = device + self.grounding_dino_server = grounding_dino_server + + if grounding_dino_server is None: + raise NotImplementedError("grounding_dino_server is None, we only support grounding_dino_server now.") + logger.info(f"Loading the model {self.model_names} on worker {worker_id} ...") + self.model = load_model( + model_config_path=model_config, + model_checkpoint_path=model_path, + device=device, + ) + self.model.to(device) + self.model.eval() + else: + self.model = None + # get grounding dino addr + if grounding_dino_server.startswith("http"): + grounding_dino_server_addr = grounding_dino_server + else: + controller_addr = self.controller_addr + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": grounding_dino_server} + ) + grounding_dino_server_addr = ret.json()["address"] + print(f"grounding_dino_server_addr: {grounding_dino_server_addr}") + self.grounding_dino_server_addr = grounding_dino_server_addr + + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + self.transform = T.Compose( + [ + T.RandomResize([800], max_size=1333), + T.ToTensor(), + T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]), + ] + ) + + # load sam model + self.sam_server = sam_server + if sam_server is None: + self.sam = build_sam(checkpoint=sam_path) + self.sam.to(device=device) + self.sam_predictor = SamPredictor(self.sam) + self.sam_server_addr = None + else: + self.sam = None + self.sam_predictor = None + # get grounding dino addr + if sam_server.startswith("http"): + sam_server_addr = sam_server + else: + time.sleep(3) + controller_addr = self.controller_addr + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": sam_server} + ) + sam_server_addr = ret.json()["address"] + print(f"sam_server_addr: {sam_server_addr}") + self.sam_server_addr = sam_server_addr + + + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def load_image(self, image_path: str) -> Tuple[np.array, torch.Tensor]: + + + if os.path.exists(image_path): + image_source = Image.open(image_path).convert("RGB") + else: + # base64 coding + image_source = Image.open(BytesIO(base64.b64decode(image_path))).convert("RGB") + + image = np.asarray(image_source) + image_transformed, _ = self.transform(image_source, None) + return image, image_transformed + + def generate_stream_func(self, model, params, device): + # get inputs + text_prompt = params["caption"] + image_path = params["image"] + box_threshold = params["box_threshold"] + text_threshold = params["text_threshold"] + + image_np, image = self.load_image(image_path) + if self.grounding_dino_server is not None: + headers = {"User-Agent": "G-SAM Client"} + pred_dict = requests.post( + self.grounding_dino_server_addr + "/worker_generate", + headers=headers, + json=params, + ).json() + boxes = pred_dict["boxes"] + logits = pred_dict["logits"] + phrases = pred_dict["phrases"] + h, w = pred_dict["size"] + else: + # load image and run models + boxes, logits, phrases = predict( + model=model, + image=image, + caption=text_prompt, + box_threshold=box_threshold, + text_threshold=text_threshold, + device=device + ) + boxes = boxes.tolist() + # round to 2 decimal places + boxes = [[round(x, 2) for x in box] for box in boxes] + logits = logits.tolist() + logits = [round(x, 2) for x in logits] + + h, w, _ = image_np.shape + pred_dict = { + "boxes": boxes, + "logits": logits, + "phrases": phrases, + "size": [h, w], # H,W + } + + # add sam output + if len(boxes) > 0: + if self.sam_server_addr is None: + boxes_tensor = torch.Tensor(boxes).to(device) + boxes_xyxy = box_ops.box_cxcywh_to_xyxy(boxes_tensor) * torch.Tensor([w, h, w, h]).to(device) + self.sam_predictor.set_image(image_np) + transformed_boxes = self.sam_predictor.transform.apply_boxes_torch(boxes_xyxy, image_np.shape[:2]).to(device) + # import ipdb; ipdb.set_trace() + masks, _, _ = self.sam_predictor.predict_torch( + point_coords = None, + point_labels = None, + boxes = transformed_boxes, + multimask_output = False, + ) + masks = masks[:, 0] # B, H, W + + # encoder masks to strs + maskrls_list = [] + for mask in masks: + mask_rle = mask_util.encode(np.array(mask[:, :, None].cpu(), order="F"))[0] + mask_rle["counts"] = mask_rle["counts"].decode("utf-8") + maskrls_list.append(mask_rle) + else: + headers = {"User-Agent": "G-SAM Client"} + params['boxes'] = boxes + pred_dict_sam = requests.post( + self.sam_server_addr + "/worker_generate", + headers=headers, + json=params, + ).json() + maskrls_list = pred_dict_sam['masks_rle'] + else: + maskrls_list = [] + + + pred_dict['masks_rle'] = maskrls_list + return pred_dict + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + self.model, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21293) + parser.add_argument("--worker-address", type=str, default="http://localhost:21293") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-path", type=str, default="groundingdino_swint_ogc.pth" + ) + parser.add_argument( + "--model-config", type=str, default="GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py" + ) + parser.add_argument( + "--sam-path", type=str, default="sam_vit_h_4b8939.pth" + ) + parser.add_argument( + "--model-names", + default="grounding_dino+sam,grounded_sam", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + parser.add_argument("--grounding-dino-server", type=str, default="grounding_dino") + parser.add_argument("--sam-server", type=str, default="sam") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.model_path, + args.model_config, + args.model_names, + args.sam_path, + args.device, + args.grounding_dino_server, + args.sam_server, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/grounding_dino_test_message.py b/fin-mm/code/LLaVA-Plus/serve/grounding_dino_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..885a7a7193a9a2c819545506972014161a136df7 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/grounding_dino_test_message.py @@ -0,0 +1,128 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +from groundingdino.util.inference import annotate, annotate_xyxy +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "FastChat Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + datas = { + "model": model_name, + "caption": args.caption, + "image": img_arg, + "box_threshold": args.box_threshold, + "text_threshold": args.text_threshold, + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + # visualize + res = response.json() + boxes = torch.Tensor(res["boxes"]) + logits = torch.Tensor(res["logits"]) + phrases = res["phrases"] + image_source = np.array(Image.open(args.image_path).convert("RGB")) + annotated_frame = annotate_xyxy(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) + cv2.imwrite("annotated_image.jpg", annotated_frame) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='grounding_dino') + + # model parameters + parser.add_argument( + "--caption", type=str, default="dogs ." + ) + parser.add_argument( + "--image_path", type=str, default="/home/liushilong/code/GroundingFolder/Grounded-Segment-Anything/assets/demo2.jpg" + ) + parser.add_argument( + "--box_threshold", type=float, default=0.3, + ) + parser.add_argument( + "--text_threshold", type=float, default=0.25, + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/grounding_dino_worker.py b/fin-mm/code/LLaVA-Plus/serve/grounding_dino_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..8152f49ccdf1e7f3a8b27c99ee837c5faa533ac2 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/grounding_dino_worker.py @@ -0,0 +1,358 @@ +""" +A model worker executes the model. +""" +import sys, os + +from groundingdino.util import box_ops +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid +import torchvision + +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +from demo.inference_on_a_image import get_grounding_output + +from groundingdino.util.inference import load_model, predict +import groundingdino.datasets.transforms as T + + +try: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LlamaTokenizer, + AutoModel, + ) +except ImportError: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LLaMATokenizer, + AutoModel, + ) +import torch +import torch.nn.functional as F +import uvicorn + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + model_path, + model_config, + model_names, + device, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + if model_path.endswith("/"): + model_path = model_path[:-1] + self.model_names = model_names or [model_path.split("/")[-1]] + self.model_config = model_config + self.device = device + + logger.info(f"Loading the model {self.model_names} on worker {worker_id} ...") + self.model = load_model( + model_config_path=model_config, + model_checkpoint_path=model_path, + device=device, + ) + self.model.to(device) + self.model.eval() + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + self.transform = T.Compose( + [ + T.RandomResize([800], max_size=1333), + T.ToTensor(), + T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]), + ] + ) + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def load_image(self, image_path: str) -> Tuple[np.array, torch.Tensor]: + + + if os.path.exists(image_path): + image_source = Image.open(image_path).convert("RGB") + else: + # base64 coding + image_source = Image.open(BytesIO(base64.b64decode(image_path))).convert("RGB") + + image = np.asarray(image_source) + image_transformed, _ = self.transform(image_source, None) + return image, image_transformed + + def generate_stream_func(self, model, params, device): + # get inputs + text_prompt = params["caption"] + image_path = params["image"] + box_threshold = params["box_threshold"] + text_threshold = params["text_threshold"] + + # load image and run models + image_np, image = self.load_image(image_path) + boxes, logits, phrases = predict( + model=model, + image=image, + caption=text_prompt, + box_threshold=box_threshold, + text_threshold=text_threshold, + device=device + ) + + # add NMS to boxes + boxes, logits, phrases = self.nms(boxes, logits, phrases) + boxes = box_ops.box_cxcywh_to_xyxy(boxes) + + # import ipdb; ipdb.set_trace() + + # to list format + boxes = boxes.tolist() + # round to 2 decimal places + boxes = [[round(x, 2) for x in box] for box in boxes] + logits = logits.tolist() + logits = [round(x, 2) for x in logits] + + h, w, _ = image_np.shape + pred_dict = { + "boxes": boxes, + "logits": logits, + "phrases": phrases, + "size": [h, w], # H,W + } + + return pred_dict + + def nms(self, boxes, logits, phrases): + iou_threshold = 0.8 + boxes_xyxy = box_ops.box_cxcywh_to_xyxy(boxes) + print(f"Before NMS: {boxes_xyxy.shape[0]} boxes") + nms_idx = torchvision.ops.nms(boxes_xyxy, logits, iou_threshold) + + boxes = boxes[nms_idx] + logits = logits[nms_idx] + phrases = [phrases[idx] for idx in nms_idx] + print(f"After NMS: {boxes.shape[0]} boxes") + + return boxes, logits, phrases + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + self.model, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21003) + parser.add_argument("--worker-address", type=str, default="http://localhost:21003") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-path", type=str, default="groundingdino_swint_ogc.pth" + ) + parser.add_argument( + "--model-config", type=str, default="GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py" + ) + parser.add_argument( + "--model-names", + default="grounding_dino", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.model_path, + args.model_config, + args.model_names, + args.device, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/inpainting_message.py b/fin-mm/code/LLaVA-Plus/serve/inpainting_message.py new file mode 100644 index 0000000000000000000000000000000000000000..5b3de5ebc424ea902462a3d61c188f7b3b55f258 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/inpainting_message.py @@ -0,0 +1,187 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +from groundingdino.util.inference import annotate, annotate_xyxy +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +import pycocotools.mask as mask_util + + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + +def show_mask(mask, image, random_color=True): + if random_color: + color = np.concatenate([np.random.random(3), np.array([0.8])], axis=0) + else: + color = np.array([30/255, 144/255, 255/255, 0.6]) + h, w = mask.shape[-2:] + mask_image = mask.reshape(h, w, 1) * color.reshape(1, 1, -1) + + annotated_frame_pil = Image.fromarray(image).convert("RGBA") + mask_image_pil = Image.fromarray((mask_image.cpu().numpy() * 255).astype(np.uint8)).convert("RGBA") + + return np.array(Image.alpha_composite(annotated_frame_pil, mask_image_pil)) + +def get_worker_addr(model_name, args): + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + _ = ret.json() + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + return worker_addr +def main(): + model_name = args.model_name + + + sam_worker_addr = get_worker_addr("sam", args) + inpainting_worker_addr = get_worker_addr("inpainting", args) + if sam_worker_addr == "" or inpainting_worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "FastChat Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + img = None + + datas = { + "model": model_name, + "image": img_arg, + "boxes": args.boxes, + } + tic = time.time() + response = requests.post( + sam_worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("segmentation result:") + print(response.json()) + + # visualize + res = response.json() + res['boxes'] = args.boxes + boxes = torch.Tensor(res["boxes"]) + logits = torch.ones(boxes.shape[0]) + phrases = ['' for _ in range(boxes.shape[0])] + if img is not None: + image_source = np.array(img.convert("RGB")) + else: + image_source = np.array(Image.open(args.image_path).convert("RGB")) + annotated_frame = annotate_xyxy(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) + # cv2.imwrite("annotated_image.jpg", annotated_frame) + + # show mask + masks_rle_list = res["masks_rle"] + for mask_rle in masks_rle_list: + mask = mask_util.decode(mask_rle) + mask = torch.Tensor(mask) + annotated_frame = show_mask(mask, annotated_frame) + cv2.imwrite("inpainting_1.jpg", annotated_frame) + + _mask = Image.fromarray(mask_util.decode(masks_rle_list[1]) * 255) + _mask.save("inpainting_mask.jpg") + # import ipdb; ipdb.set_trace() + + # inpainting + datas = { + "image": img_arg, + "mask": masks_rle_list[1], + "prompt": args.prompt, + } + + tic = time.time() + response = requests.post( + inpainting_worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + res = response.json() + image = Image.open(BytesIO(base64.b64decode(res['edited_image']))).convert("RGB") + # import ipdb; ipdb.set_trace() + # save + image.save("inpainting_2.jpg") + + + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='sam') + + # model parameters + parser.add_argument( + "--prompt", type=str, default="flowers" + ) + parser.add_argument( + "--boxes", + default="[[0.1, 0.2, 0.8, 0.5], [0.3, 0.5, 0.9, 0.9]]", + type=lambda s: eval(s), + help="Optional display comma separated names", + ) + parser.add_argument( + "--image_path", type=str, default="assets/demo2.jpg" + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/inpainting_worker.py b/fin-mm/code/LLaVA-Plus/serve/inpainting_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..ef1facc7e5a332c500c45eda11b2429f1acb42e8 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/inpainting_worker.py @@ -0,0 +1,330 @@ +""" +A model worker executes the model. +""" +import sys, os +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid + +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +from demo.inference_on_a_image import get_grounding_output + +from groundingdino.util.inference import load_model, predict +import groundingdino.datasets.transforms as T +from diffusers import StableDiffusionInpaintPipeline + + +try: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LlamaTokenizer, + AutoModel, + ) +except ImportError: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LLaMATokenizer, + AutoModel, + ) +from transformers import AutoProcessor, Blip2ForConditionalGeneration + +import torch +import torch.nn.functional as F +import uvicorn + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +import pycocotools.mask as mask_util + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + model_path, + model_names, + device, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + self.model_names = model_names + self.device = device + + # # load model + pipe = StableDiffusionInpaintPipeline.from_pretrained( + "stabilityai/stable-diffusion-2-inpainting", + torch_dtype=torch.float16, + ) + + pipe = pipe.to("cuda") + + self.pipe = pipe + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + def resize(self, image:Image, resize_w:int, resize_h:int): + image = image.resize((resize_w, resize_h)) + return image + + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def load_image(self, image_path: str) -> Tuple[np.array, torch.Tensor]: + + + if os.path.exists(image_path): + image_source = Image.open(image_path).convert("RGB") + else: + # base64 coding + image_source = Image.open(BytesIO(base64.b64decode(image_path))).convert("RGB") + + return image_source + + def generate_stream_func(self, model, params, device): + # get inputs + image_path = params["image"] + prompt = params["prompt"] + mask_rle = params["mask"] # rle + + # load image and run models + image = self.load_image(image_path) + mask = Image.fromarray(mask_util.decode(mask_rle) * 255) + + # resize to 512, 512 + w, h = image.size + image = self.resize(image, 512, 512) + mask = self.resize(mask, 512, 512) + + # run + images = self.pipe(prompt, image=image, mask_image=mask).images + image = images[0] + + # re-resize + image = self.resize(image, w, h) + + pred_dict = { + "edited_image": encode(image), + } + + return pred_dict + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + None, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=23336) + parser.add_argument("--worker-address", type=str, default="http://localhost:23336") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-path", type=str, default="Salesforce/blip2-opt-2.7b" + ) + + parser.add_argument( + "--model-names", + default="inpainting", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.model_path, + args.model_names, + args.device, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/instructpix2pix_test_message.py b/fin-mm/code/LLaVA-Plus/serve/instructpix2pix_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..a3c149e55a5a5a03cccd9501ea935eac5d967992 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/instructpix2pix_test_message.py @@ -0,0 +1,115 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +from groundingdino.util.inference import annotate +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "GSAM Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + datas = { + "model": model_name, + "image": img_arg, + "prompt": "Hi AI! make them like a cat" + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + res = response.json() + + image = Image.open(BytesIO(base64.b64decode(res['edited_image']))).convert("RGB") + # save + image.save("demo2_edited2.jpg") + + + + + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='ip2p') + + # model parameters + parser.add_argument( + "--image_path", type=str, default="78851692243550_.pic.jpg" + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/instructpix2pix_worker.py b/fin-mm/code/LLaVA-Plus/serve/instructpix2pix_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..ef9f50c00cb9831e842f0f383367a22af7f50b3a --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/instructpix2pix_worker.py @@ -0,0 +1,330 @@ +""" +A model worker executes the model. +""" +import sys, os +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid + +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +from demo.inference_on_a_image import get_grounding_output + +from groundingdino.util.inference import load_model, predict +import groundingdino.datasets.transforms as T +from diffusers import StableDiffusionInstructPix2PixPipeline, EulerAncestralDiscreteScheduler + +try: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LlamaTokenizer, + AutoModel, + ) +except ImportError: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LLaMATokenizer, + AutoModel, + ) +from transformers import AutoProcessor, Blip2ForConditionalGeneration + +import torch +import torch.nn.functional as F +import uvicorn + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + model_path, + model_names, + device, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + self.model_names = model_names + self.device = device + + # # load model + # logger.info(f"Loading the model {self.model_names} on worker {worker_id} ...") + # self.processor = AutoProcessor.from_pretrained(model_path) + # self.model = Blip2ForConditionalGeneration.from_pretrained(model_path, torch_dtype=torch.float16) + # self.model.eval() + # self.model.to(device) + model_id = "timbrooks/instruct-pix2pix" + pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dtype=torch.float16) + pipe.to("cuda") + pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config) + + self.pipe = pipe + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + def resize(self, image:Image, resize_w:int, resize_h:int): + image = image.resize((resize_w, resize_h)) + return image + + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def load_image(self, image_path: str) -> Tuple[np.array, torch.Tensor]: + + + if os.path.exists(image_path): + image_source = Image.open(image_path).convert("RGB") + else: + # base64 coding + image_source = Image.open(BytesIO(base64.b64decode(image_path))).convert("RGB") + + return image_source + + def generate_stream_func(self, model, params, device): + # get inputs + image_path = params["image"] + prompt = params["prompt"] + + # load image and run models + image = self.load_image(image_path) + + # resize to 512, 512 + w, h = image.size + image = self.resize(image, 512, 512) + + # run + images = self.pipe(prompt, image=image, num_inference_steps=30, image_guidance_scale=1).images + image = images[0] + + # re-resize + image = self.resize(image, w, h) + + # save image + # images[0].save("test.jpg") + + pred_dict = { + "edited_image": encode(image), + } + + return pred_dict + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + None, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21306) + parser.add_argument("--worker-address", type=str, default="http://localhost:21306") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-path", type=str, default="Salesforce/blip2-opt-2.7b" + ) + + parser.add_argument( + "--model-names", + default="instruct-pix2pix,ip2p", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.model_path, + args.model_names, + args.device, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/ocr_test_message.py b/fin-mm/code/LLaVA-Plus/serve/ocr_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..7ee23fbf8f2c583032230be39b0a28071fb58188 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/ocr_test_message.py @@ -0,0 +1,109 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +from groundingdino.util.inference import annotate +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "GSAM Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + datas = { + "model": model_name, + "image": img_arg, + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='ocr') + + # model parameters + parser.add_argument( + "--image_path", type=str, default='/home/liushilong/code/GroundingFolder/Grounded-Segment-Anything/assets/grounded_sam2.png' + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/ocr_worker.py b/fin-mm/code/LLaVA-Plus/serve/ocr_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..a4a7cdb6b733223fb8e60d30f00af98d50d79479 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/ocr_worker.py @@ -0,0 +1,310 @@ +""" +A model worker executes the model. +""" +from functools import partial +import sys, os +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid + +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image +import easyocr + +sys.path.append('Tag2Text') +from Tag2Text.models import tag2text +from Tag2Text import inference_ram +import torchvision.transforms as TS + +try: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LlamaTokenizer, + AutoModel, + ) +except ImportError: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LLaMATokenizer, + AutoModel, + ) +from transformers import AutoProcessor, Blip2ForConditionalGeneration + +import torch +import torch.nn.functional as F +import uvicorn + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + +R = partial(round, ndigits=2) + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + model_path, + model_names, + device, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + self.model_names = model_names + self.device = device + + # load model + self.ocr_model = easyocr.Reader(['ch_sim','en']) + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def load_image(self, image_path: str) -> Tuple[np.array, torch.Tensor]: + + if os.path.exists(image_path): + image_source = Image.open(image_path).convert("RGB") + else: + # base64 coding + image_source = Image.open(BytesIO(base64.b64decode(image_path))).convert("RGB") + return image_source + + def generate_stream_func(self, model, params, device): + # get inputs + image_path = params["image"] + + # load image and run models + image = self.load_image(image_path) + + # tagging: + result = self.ocr_model.readtext(np.array(image)) + + boxes = [i[0] for i in result] + # int 64 -> int + # boxes = [[[int(ib[0]), int(ib[1])]for ib in box] for box in boxes] + # [[x1y1, x2y1, x2y2, x1y2]] -> [x1, y1, x2, y2] + boxes = [[int(box[0][0]), int(box[0][1]), int(box[2][0]), int(box[2][1])] for box in boxes] + # w, h + w, h = image.size + boxes = [[R(box[0] / w), R(box[1] / h), R(box[2] / w), R(box[3] / h)] for box in boxes] + + pred_dict = { + "boxes": boxes, + "texts": [i[1] for i in result], + "scores": [R(i[2]) for i in result], # H,W + } + + return pred_dict + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + None, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21029) + parser.add_argument("--worker-address", type=str, default="http://localhost:21029") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-path", type=str, default="" + ) + + parser.add_argument( + "--model-names", + default="ocr,easyocr", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.model_path, + args.model_names, + args.device, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/openseed_controlnet_test_message.py b/fin-mm/code/LLaVA-Plus/serve/openseed_controlnet_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..b4b103a65251af95e82eb13cf963e1c0da0d6a24 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/openseed_controlnet_test_message.py @@ -0,0 +1,123 @@ +"""Send a test message.""" +import argparse +import time +from io import BytesIO +import io +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "FastChat Client"} + img_arg = args.image_path + image = load_image(img_arg).convert('RGB') + image_data = io.BytesIO() + image.save(image_data, format='JPEG') + image_data_bytes = image_data.getvalue() + # 将图像数据编码为Base64字符串 + encoded_image = base64.b64encode(image_data_bytes).decode('utf-8') + mode=args.mode + datas = { + "caption": args.caption, + "image": encoded_image, + "mask":None, + "mode":mode + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + # visualize + res = response.json() + image_seg = res["image_seg"] + image_result = res["image"] + if image_seg is not None: + image_seg=Image.open(io.BytesIO(base64.b64decode(image_seg))).convert("RGB") + image_seg.save("output/seg.jpg") + if image_seg is not None: + image_result=Image.open(io.BytesIO(base64.b64decode(image_result))).convert("RGB") + image_result.save("output/result.jpg") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str, default="http://localhost:22003") + parser.add_argument("--model-name", type=str, default='grounding_dino') + parser.add_argument("--mode", type=str, default='openseed') + # parser.add_argument("--model-name", type=str, default='grounding_dino') + + # model parameters + parser.add_argument( + "--caption", type=str, default="house" + ) + parser.add_argument( + "--image_path", type=str, default="house.png" + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/openseed_controlnet_worker.py b/fin-mm/code/LLaVA-Plus/serve/openseed_controlnet_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..2a444d71b6a9447d956e9d22c5919e3beb67a154 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/openseed_controlnet_worker.py @@ -0,0 +1,490 @@ +""" +A model worker executes the model. +""" +import numpy as np +np.random.seed(1) +import sys, os, io +# import pdb;pdb.set_trace() +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +import torch +from torchvision import transforms + + +from detectron2.data import MetadataCatalog +from detectron2.utils.colormap import random_color +from openseed.BaseModel import BaseModel +from openseed import build_model +from utils.arguments import load_opt_from_config_files +import argparse +import asyncio + +import sys +import time +import threading +import uuid +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import requests + +import torch.nn.functional as F +import uvicorn + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils_ import build_logger, pretty_print_semaphore + +from PIL import Image +import numpy as np +import torch +from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler +from diffusers.utils import load_image +import numpy as np + +ade20k_classes=['wall', 'building', 'sky', 'floor', 'tree', 'ceiling', 'road', 'bed', 'window ', 'grass', 'cabinet', 'sidewalk', 'person', 'earth', 'door', 'table', 'mountain', 'plant', 'curtain', 'chair', 'car', 'water', 'painting', 'sofa', 'shelf', 'house', 'sea', 'mirror', 'rug', 'field', 'armchair', 'seat', 'fence', 'desk', 'rock', 'wardrobe', 'lamp', 'tub', 'rail', 'cushion', 'base', 'box', 'column', 'signboard', 'chest of drawers', 'counter', 'sand', 'sink', 'skyscraper', 'fireplace', 'refrigerator', 'grandstand', 'path', 'stairs', 'runway', 'case', 'pool table', 'pillow', 'screen door', 'stairway', 'river', 'bridge', 'bookcase', 'blind', 'coffee table', 'toilet', 'flower', 'book', 'hill', 'bench', 'countertop', 'stove', 'palm', 'kitchen island', 'computer', 'swivel chair', 'boat', 'bar', 'arcade machine', 'hovel', 'bus', 'towel', 'light', 'truck', 'tower', 'chandelier', 'awning', 'street lamp', 'booth', 'tv', 'plane', 'dirt track', 'clothes', 'pole', 'land', 'bannister', 'escalator', 'ottoman', 'bottle', 'buffet', 'poster', 'stage', 'van', 'ship', 'fountain', 'conveyer belt', 'canopy', 'washer', 'plaything', 'pool', 'stool', 'barrel', 'basket', 'falls', 'tent', 'bag', 'minibike', 'cradle', 'oven', 'ball', 'food', 'step', 'tank', 'trade name', 'microwave', 'pot', 'animal', 'bicycle', 'lake', 'dishwasher', 'screen', 'blanket', 'sculpture', 'hood', 'sconce', 'vase', 'traffic light', 'tray', 'trash can', 'fan', 'pier', 'crt screen', 'plate', 'monitor', 'bulletin board', 'shower', 'radiator', 'glass', 'clock', 'flag'] +palette = np.asarray([ + [0, 0, 0], + [120, 120, 120], + [180, 120, 120], + [6, 230, 230], + [80, 50, 50], + [4, 200, 3], + [120, 120, 80], + [140, 140, 140], + [204, 5, 255], + [230, 230, 230], + [4, 250, 7], + [224, 5, 255], + [235, 255, 7], + [150, 5, 61], + [120, 120, 70], + [8, 255, 51], + [255, 6, 82], + [143, 255, 140], + [204, 255, 4], + [255, 51, 7], + [204, 70, 3], + [0, 102, 200], + [61, 230, 250], + [255, 6, 51], + [11, 102, 255], + [255, 7, 71], + [255, 9, 224], + [9, 7, 230], + [220, 220, 220], + [255, 9, 92], + [112, 9, 255], + [8, 255, 214], + [7, 255, 224], + [255, 184, 6], + [10, 255, 71], + [255, 41, 10], + [7, 255, 255], + [224, 255, 8], + [102, 8, 255], + [255, 61, 6], + [255, 194, 7], + [255, 122, 8], + [0, 255, 20], + [255, 8, 41], + [255, 5, 153], + [6, 51, 255], + [235, 12, 255], + [160, 150, 20], + [0, 163, 255], + [140, 140, 140], + [250, 10, 15], + [20, 255, 0], + [31, 255, 0], + [255, 31, 0], + [255, 224, 0], + [153, 255, 0], + [0, 0, 255], + [255, 71, 0], + [0, 235, 255], + [0, 173, 255], + [31, 0, 255], + [11, 200, 200], + [255, 82, 0], + [0, 255, 245], + [0, 61, 255], + [0, 255, 112], + [0, 255, 133], + [255, 0, 0], + [255, 163, 0], + [255, 102, 0], + [194, 255, 0], + [0, 143, 255], + [51, 255, 0], + [0, 82, 255], + [0, 255, 41], + [0, 255, 173], + [10, 0, 255], + [173, 255, 0], + [0, 255, 153], + [255, 92, 0], + [255, 0, 255], + [255, 0, 245], + [255, 0, 102], + [255, 173, 0], + [255, 0, 20], + [255, 184, 184], + [0, 31, 255], + [0, 255, 61], + [0, 71, 255], + [255, 0, 204], + [0, 255, 194], + [0, 255, 82], + [0, 10, 255], + [0, 112, 255], + [51, 0, 255], + [0, 194, 255], + [0, 122, 255], + [0, 255, 163], + [255, 153, 0], + [0, 255, 10], + [255, 112, 0], + [143, 255, 0], + [82, 0, 255], + [163, 255, 0], + [255, 235, 0], + [8, 184, 170], + [133, 0, 255], + [0, 255, 92], + [184, 0, 255], + [255, 0, 31], + [0, 184, 255], + [0, 214, 255], + [255, 0, 112], + [92, 255, 0], + [0, 224, 255], + [112, 224, 255], + [70, 184, 160], + [163, 0, 255], + [153, 0, 255], + [71, 255, 0], + [255, 0, 163], + [255, 204, 0], + [255, 0, 143], + [0, 255, 235], + [133, 255, 0], + [255, 0, 235], + [245, 0, 255], + [255, 0, 122], + [255, 245, 0], + [10, 190, 212], + [214, 255, 0], + [0, 204, 255], + [20, 0, 255], + [255, 255, 0], + [0, 153, 255], + [0, 41, 255], + [0, 255, 204], + [41, 0, 255], + [41, 255, 0], + [173, 0, 255], + [0, 245, 255], + [71, 0, 255], + [122, 0, 255], + [0, 255, 184], + [0, 92, 255], + [184, 255, 0], + [0, 133, 255], + [255, 214, 0], + [25, 194, 194], + [102, 255, 0], + [92, 0, 255], +]) + + + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +conf_files="configs/openseed/openseed_swinl_lang_decouple.yaml" +pretrained_pth="/path/to/openseed_ade20k_swinl.pt" +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + model_names, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + self.model_names = model_names + + # self.image_processor = AutoImageProcessor.from_pretrained("openmmlab/upernet-convnext-small") + # self.image_segmentor = UperNetForSemanticSegmentation.from_pretrained("openmmlab/upernet-convnext-small") + self.controlnet = ControlNetModel.from_pretrained( + "lllyasviel/sd-controlnet-seg", torch_dtype=torch.float32 + ) + + self.pipe = StableDiffusionControlNetPipeline.from_pretrained( + "runwayml/stable-diffusion-v1-5", controlnet=self.controlnet, safety_checker=None, torch_dtype=torch.float32 + ) + self.pipe.scheduler = UniPCMultistepScheduler.from_config(self.pipe.scheduler.config) + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + opt = load_opt_from_config_files([conf_files]) + # if cmdline_args.user_dir: + # absolute_user_dir = os.path.abspath(cmdline_args.user_dir) + # opt['user_dir'] = absolute_user_dir + + # META DATA + # pretrained_pth = os.path.join(opt['WEIGHT']) + # output_root = './output' + # image_pth = 'images/animals.png' + + self.openseed_model = BaseModel(opt, build_model(opt)).from_pretrained(pretrained_pth).eval().cuda() + + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + + def generate_stream_func(self, params ): + # get inputs + image_b64 = params["image"] + mode = params["mode"] + if mode=="openseed": + t = [] + t.append(transforms.Resize(512, interpolation=Image.BICUBIC)) + transform = transforms.Compose(t) + + stuff_classes = ade20k_classes + stuff_colors = [random_color(rgb=True, maximum=255).astype(np.int).tolist() for _ in + range(len(stuff_classes))] + stuff_dataset_id_to_contiguous_id = {x: x for x in range(len(stuff_classes))} + + MetadataCatalog.get("demo").set( + stuff_colors=stuff_colors, + stuff_dataset_id_to_contiguous_id=stuff_dataset_id_to_contiguous_id, + ) + model=self.openseed_model + model.model.sem_seg_head.predictor.lang_encoder.get_text_embeddings(stuff_classes, is_eval=True) + metadata = MetadataCatalog.get('inference') + model.model.metadata = metadata + model.model.sem_seg_head.num_classes = len(stuff_classes) + with torch.no_grad(): + image_ori = Image.open(io.BytesIO(base64.b64decode(image_b64))).convert("RGB") + width = image_ori.size[0] + height = image_ori.size[1] + image = transform(image_ori) + image = np.asarray(image) + images = torch.from_numpy(image.copy()).permute(2, 0, 1).cuda() + + batch_inputs = [{'image': images, 'height': height, 'width': width}] + outputs = model.forward(batch_inputs, inference_task="sem_seg") + # outputs[-1]['sem_seg'] = F.interpolate(outputs[-1]['sem_seg'][None], size=(512, 512), mode='bilinear', + # align_corners=False)[0].cpu() + seg = outputs[-1]['sem_seg'].max(0)[1].cpu() + + #seg: 512x512 (0~149) + color_seg = np.zeros((seg.shape[0], seg.shape[1], 3), dtype=np.uint8) # height, width, 3 + + for label, color in enumerate(palette): + color_seg[seg == label, :] = color + + color_seg = color_seg.astype(np.uint8) + + image = Image.fromarray(color_seg) + image_data = io.BytesIO() + image.save(image_data, format='JPEG') + image_data_bytes = image_data.getvalue() + # 将图像数据编码为Base64字符串 + encoded_image = base64.b64encode(image_data_bytes).decode('utf-8') + pred_dict = { + "image_seg": encoded_image, + } + else: + assert mode=="controlnet" + text_prompt = params["prompt"]["caption"] + image=params['mask'] + image = Image.open(io.BytesIO(base64.b64decode(image))).convert("RGB") + image1 = self.pipe(text_prompt, image, num_inference_steps=20).images[0] + + + image_data1 = io.BytesIO() + image1.save(image_data1, format='JPEG') + image_data_bytes1 = image_data1.getvalue() + # 将图像数据编码为Base64字符串 + encoded_image1 = base64.b64encode(image_data_bytes1).decode('utf-8') + + pred_dict = { + "edited_image": encoded_image1, + } + + return pred_dict + + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + params + ) + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=22003) + parser.add_argument("--worker-address", type=str, default="http://localhost:22003") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-names", + default="controlnet", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.model_names + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/openseed_controlnet_worker_readme.md b/fin-mm/code/LLaVA-Plus/serve/openseed_controlnet_worker_readme.md new file mode 100644 index 0000000000000000000000000000000000000000..59c0f11668b5afaf709359e9927ee23ad9364800 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/openseed_controlnet_worker_readme.md @@ -0,0 +1,18 @@ +# OpenSeeD and ControlNet Worker +## Install +```sh +git clone https://github.com/IDEA-Research/OpenSeeD.git +cd OpenSeeD +mkdir serve +cp openseed_controlnet_worker.py openseed_controlnet_test_message.py serve/ +mkdir ckpt +wget https://github.com/IDEA-Research/OpenSeeD/releases/download/ade20k_swinl/openseed_ade20k_swinl.pt +mv openseed_ade20k_swinl.pt ckpt/ +``` +## Run +```sh +#start worker +python serve/openseed_controlnet_worker.py +#test worker +python serve/openseed_controlnet_test_message.py +``` \ No newline at end of file diff --git a/fin-mm/code/LLaVA-Plus/serve/ram_grounding_test_message.py b/fin-mm/code/LLaVA-Plus/serve/ram_grounding_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..d0741b4b14eac5863aa361a85a0d1e8a4586def1 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/ram_grounding_test_message.py @@ -0,0 +1,124 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +from groundingdino.util.inference import annotate +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "GSAM Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + datas = { + "model": model_name, + "image": img_arg, + "box_threshold": args.box_threshold, + "text_threshold": args.text_threshold, + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + + # visualize + res = response.json() + boxes = torch.Tensor(res["boxes"]) + logits = torch.Tensor(res["logits"]) + phrases = res["phrases"] + image_source = np.array(Image.open(args.image_path).convert("RGB")) + annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) + cv2.imwrite("annotated_image.jpg", annotated_frame) + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='ram+grounding_dino') + + # model parameters + parser.add_argument( + "--image_path", type=str, default="/home/liushilong/code/GroundingFolder/Grounded-Segment-Anything/assets/demo2.jpg" + ) + parser.add_argument( + "--box_threshold", type=float, default=0.3, + ) + parser.add_argument( + "--text_threshold", type=float, default=0.25, + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/ram_grounding_worker.py b/fin-mm/code/LLaVA-Plus/serve/ram_grounding_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..9460211427b146f5f26699fa4d455b3ae00b3eb8 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/ram_grounding_worker.py @@ -0,0 +1,346 @@ +""" +A model worker executes the model. +""" +import sys, os +from groundingdino.util import box_ops + +from segment_anything import build_sam +from segment_anything.predictor import SamPredictor +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid + +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +from demo.inference_on_a_image import get_grounding_output + +from groundingdino.util.inference import load_model, predict +import groundingdino.datasets.transforms as T +import pycocotools.mask as mask_util + + +try: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LlamaTokenizer, + AutoModel, + ) +except ImportError: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LLaMATokenizer, + AutoModel, + ) +import torch +import torch.nn.functional as F +import uvicorn + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + grounding_dino_server, + ram_server, + model_names, + device, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + self.model_names = model_names + self.device = device + + self.grounding_dino_server = grounding_dino_server + self.grounding_dino_server_addr = self.get_sub_worker_addr(grounding_dino_server) + print(f"grounding_dino_server_addr: {self.grounding_dino_server_addr}") + + self.ram_server = ram_server + self.ram_server_addr = self.get_sub_worker_addr(ram_server) + print(f"ram_server_addr: {self.ram_server_addr}") + + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + + def get_sub_worker_addr(self, worker_name): + # get grounding dino addr + if worker_name.startswith("http"): + sub_server_addr = worker_name + else: + controller_addr = self.controller_addr + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": worker_name} + ) + sub_server_addr = ret.json()["address"] + # print(f"worker_name: {worker_name}") + return sub_server_addr + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def load_image(self, image_path: str) -> Tuple[np.array, torch.Tensor]: + + + if os.path.exists(image_path): + image_source = Image.open(image_path).convert("RGB") + else: + # base64 coding + image_source = Image.open(BytesIO(base64.b64decode(image_path))).convert("RGB") + + image = np.asarray(image_source) + image_transformed, _ = self.transform(image_source, None) + return image, image_transformed + + def generate_stream_func(self, model, params, device): + # get inputs + + + + headers = {"User-Agent": "G-SAM Client"} + + # ram + pred_dict_ram = requests.post( + self.ram_server_addr + "/worker_generate", + headers=headers, + json=params, + ).json() + + params.update({ + "caption": pred_dict_ram["tags"].replace(",", ".") + }) + + # gdino + pred_dict_gdino = requests.post( + self.grounding_dino_server_addr + "/worker_generate", + headers=headers, + json=params, + ).json() + + pred_dict_gdino.update({ + "tags": pred_dict_ram["tags"], + "tags_chinese": pred_dict_ram["tags_chinese"], + }) + + return pred_dict_gdino + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + None, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=22078) + parser.add_argument("--worker-address", type=str, default="http://localhost:22078") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--grounding-dino-server", type=str, default="grounding_dino" + ) + parser.add_argument( + "--ram-server", type=str, default="ram" + ) + parser.add_argument( + "--model-names", + default="ram+grounding_dino", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.grounding_dino_server, + args.ram_server, + args.model_names, + args.device, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/ram_test_message.py b/fin-mm/code/LLaVA-Plus/serve/ram_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..dcb7c4d8616d8cacbbbbbb0b15a76e0bc32af4c6 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/ram_test_message.py @@ -0,0 +1,109 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +from groundingdino.util.inference import annotate +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "GSAM Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + datas = { + "model": model_name, + "image": img_arg, + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='ram') + + # model parameters + parser.add_argument( + "--image_path", type=str, default="/home/liushilong/code/GroundingFolder/Grounded-Segment-Anything/assets/demo2.jpg" + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/ram_worker.py b/fin-mm/code/LLaVA-Plus/serve/ram_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..52f59dcb95e0894e8f8b9ef18042d72ac0cff9b4 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/ram_worker.py @@ -0,0 +1,384 @@ +""" +A model worker executes the model. +""" +import sys, os +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid + +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +sys.path.append('Tag2Text') +from Tag2Text.models import tag2text +from Tag2Text import inference_ram +import torchvision.transforms as TS + +try: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LlamaTokenizer, + AutoModel, + ) +except ImportError: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LLaMATokenizer, + AutoModel, + ) +from transformers import AutoProcessor, Blip2ForConditionalGeneration + +import torch +import torch.nn.functional as F +import uvicorn + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + model_path, + model_names, + device, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + if model_path.endswith("/"): + model_path = model_path[:-1] + self.model_names = model_names or [model_path.split("/")[-1]] + self.device = device + + # load model + logger.info(f"Loading the model {self.model_names} on worker {worker_id} ...") + self.ram_model = tag2text.ram(pretrained=model_path, + image_size=384, + vit='swin_l') + self.ram_model.to(device) + self.ram_model.eval() + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def load_image(self, image_path: str) -> Tuple[np.array, torch.Tensor]: + + + if os.path.exists(image_path): + image_source = Image.open(image_path).convert("RGB") + else: + # base64 coding + image_source = Image.open(BytesIO(base64.b64decode(image_path))).convert("RGB") + + normalize = TS.Normalize(mean=[0.485, 0.456, 0.406], + std=[0.229, 0.224, 0.225]) + transform = TS.Compose([ + TS.Resize((384, 384)), + TS.ToTensor(), normalize + ]) + image_source = transform(image_source) + return image_source + + def generate_stream_func(self, model, params, device): + # get inputs + image_path = params["image"] + + # load image and run models + image = self.load_image(image_path).unsqueeze(0).to(device) + + # tagging: + res = inference_ram.inference(image , self.ram_model) + + tags=res[0].replace(' |', ',') + tags_chinese=res[1].replace(' |', ',') + + _, __, h, w = image.shape + pred_dict = { + "tags": tags, + "tags_chinese": tags_chinese, + "size": [h, w], # H,W + } + + return pred_dict + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + self.ram_model, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + @torch.inference_mode() + def get_embeddings(self, params): + try: + tokenizer = self.tokenizer + is_llama = "llama" in str( + type(self.model) + ) # vicuna support batch inference + is_chatglm = "chatglm" in str(type(self.model)) + is_t5 = "t5" in str(type(self.model)) + if is_llama: + encoding = tokenizer.batch_encode_plus( + params["input"], padding=True, return_tensors="pt" + ) + input_ids = encoding["input_ids"].to(self.device) + attention_mask = encoding["attention_mask"].to(self.device) + model_output = self.model( + input_ids, attention_mask, output_hidden_states=True + ) + data = model_output.hidden_states[-1] + mask = attention_mask.unsqueeze(-1).expand(data.size()).float() + masked_embeddings = data * mask + sum_embeddings = torch.sum(masked_embeddings, dim=1) + seq_length = torch.sum(mask, dim=1) + embedding = sum_embeddings / seq_length + normalized_embeddings = F.normalize(embedding, p=2, dim=1) + ret = { + "embedding": normalized_embeddings.tolist(), + "token_num": torch.sum(attention_mask).item(), + } + else: + embedding = [] + token_num = 0 + for text in params["input"]: + input_ids = tokenizer.encode(text, return_tensors="pt").to( + self.device + ) + if is_t5: + model_output = self.model( + input_ids, decoder_input_ids=input_ids + ) + else: + model_output = self.model(input_ids, output_hidden_states=True) + if is_chatglm: + data = (model_output.hidden_states[-1].transpose(0, 1))[0] + elif is_t5: + data = model_output.encoder_last_hidden_state[0] + else: + data = model_output.hidden_states[-1][0] + data = F.normalize(torch.mean(data, dim=0), p=2, dim=0) + embedding.append(data.tolist()) + token_num += len(input_ids[0]) + ret = { + "embedding": embedding, + "token_num": token_num, + } + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21009) + parser.add_argument("--worker-address", type=str, default="http://localhost:21009") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-path", type=str, default="ram_swin_large_14m.pth" + ) + + parser.add_argument( + "--model-names", + default="ram", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.model_path, + args.model_names, + args.device, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/sam_test_message.py b/fin-mm/code/LLaVA-Plus/serve/sam_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..51c9fb0d857c528c1b5f28eb78136f5b3e96a25f --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/sam_test_message.py @@ -0,0 +1,153 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +from groundingdino.util.inference import annotate, annotate_xyxy +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +import pycocotools.mask as mask_util + + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + +def show_mask(mask, image, random_color=True): + if random_color: + color = np.concatenate([np.random.random(3), np.array([0.8])], axis=0) + else: + color = np.array([30/255, 144/255, 255/255, 0.6]) + h, w = mask.shape[-2:] + mask_image = mask.reshape(h, w, 1) * color.reshape(1, 1, -1) + + annotated_frame_pil = Image.fromarray(image).convert("RGBA") + mask_image_pil = Image.fromarray((mask_image.cpu().numpy() * 255).astype(np.uint8)).convert("RGBA") + + return np.array(Image.alpha_composite(annotated_frame_pil, mask_image_pil)) + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "FastChat Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + img = None + datas = { + "model": model_name, + "image": img_arg, + "boxes": args.boxes, + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + # visualize + res = response.json() + res['boxes'] = args.boxes + boxes = torch.Tensor(res["boxes"]) + logits = torch.ones(boxes.shape[0]) + phrases = ['' for _ in range(boxes.shape[0])] + if img is not None: + image_source = np.array(img.convert("RGB")) + else: + image_source = np.array(Image.open(args.image_path).convert("RGB")) + annotated_frame = annotate_xyxy(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) + # cv2.imwrite("annotated_image.jpg", annotated_frame) + + # show mask + masks_rle = res["masks_rle"] + for mask_rle in masks_rle: + mask = mask_util.decode(mask_rle) + mask = torch.Tensor(mask) + annotated_frame = show_mask(mask, annotated_frame) + cv2.imwrite("annotated_image_mask.jpg", annotated_frame) + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='sam') + + # model parameters + parser.add_argument( + "--caption", type=str, default="dogs ." + ) + parser.add_argument( + "--boxes", + default="[[0.1, 0.2, 0.8, 0.5], [0.3, 0.5, 0.9, 0.9]]", + type=lambda s: eval(s), + help="Optional display comma separated names", + ) + parser.add_argument( + "--image_path", type=str, default="assets/demo2.jpg" + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/sam_test_message_points.py b/fin-mm/code/LLaVA-Plus/serve/sam_test_message_points.py new file mode 100644 index 0000000000000000000000000000000000000000..52cbde7876fcbc99b301682809cffb43f681e8e3 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/sam_test_message_points.py @@ -0,0 +1,167 @@ +"""Send a test message.""" +import argparse +import json +import random +import time +from io import BytesIO +import cv2 +from groundingdino.util.inference import annotate, annotate_xyxy +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +import pycocotools.mask as mask_util + + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + +def show_mask(mask, image, random_color=True): + if random_color: + color = np.concatenate([np.random.random(3), np.array([0.8])], axis=0) + else: + color = np.array([30/255, 144/255, 255/255, 0.6]) + h, w = mask.shape[-2:] + mask_image = mask.reshape(h, w, 1) * color.reshape(1, 1, -1) + + annotated_frame_pil = Image.fromarray(image).convert("RGBA") + mask_image_pil = Image.fromarray((mask_image.cpu().numpy() * 255).astype(np.uint8)).convert("RGBA") + + return np.array(Image.alpha_composite(annotated_frame_pil, mask_image_pil)) + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "FastChat Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + img = None + + # random points + points = np.random.rand(1, 3, 2).tolist() + point_labels = (np.random.rand(1, 3) > 0.5).astype(np.int32).tolist() + if sum(point_labels[0]) == 0: + point_labels[0][random.randint(0, 2)] = 1 + + + + datas = { + "model": model_name, + "image": img_arg, + "points": points, + "point_labels": point_labels, + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + # visualize + res = response.json() + # res['boxes'] = args.boxes + # boxes = torch.Tensor(res["boxes"]) + # logits = torch.ones(boxes.shape[0]) + # phrases = ['' for _ in range(boxes.shape[0])] + if img is not None: + image_source = np.array(img.convert("RGB")) + else: + image_source = np.array(Image.open(args.image_path).convert("RGB")) + # annotated_frame = annotate_xyxy(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) + # cv2.imwrite("annotated_image.jpg", annotated_frame) + + # show mask + masks_rle = res["masks_rle"] + for mask_rle in masks_rle: + mask = mask_util.decode(mask_rle) + mask = torch.Tensor(mask) + annotated_frame = show_mask(mask, image_source) + annotated_frame = cv2.cvtColor(annotated_frame, cv2.COLOR_RGB2BGR) + + # show points + points = np.array(points) + point_labels = np.array(point_labels) + h, w = annotated_frame.shape[:2] + for i in range(points.shape[1]): + color = (0, 255, 0) if point_labels[0, i] == 1 else (0, 0, 255) + annotated_frame = cv2.circle(annotated_frame, (int(points[0, i, 0] * w), int(points[0, i, 1] * h)), 5, color, -1) + cv2.imwrite("annotated_image_mask.jpg", annotated_frame) + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='sam') + + # model parameters + parser.add_argument( + "--caption", type=str, default="dogs ." + ) + parser.add_argument( + "--image_path", type=str, default="/home/liushilong/code/GroundingFolder/Grounded-Segment-Anything/assets/demo2.jpg" + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/sam_worker.py b/fin-mm/code/LLaVA-Plus/serve/sam_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..58910f1241940dd8bbe5465dd0a4c7e1d163be79 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/sam_worker.py @@ -0,0 +1,425 @@ +""" +A model worker executes the model. +""" +import sys, os +from groundingdino.util import box_ops + +from segment_anything import build_sam +from segment_anything.predictor import SamPredictor +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid + +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +from demo.inference_on_a_image import get_grounding_output + +from groundingdino.util.inference import load_model, predict +import groundingdino.datasets.transforms as T +import pycocotools.mask as mask_util + + +try: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LlamaTokenizer, + AutoModel, + ) +except ImportError: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LLaMATokenizer, + AutoModel, + ) +import torch +import torch.nn.functional as F +import uvicorn + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + model_names, + sam_path, + device, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + self.model_names = model_names + self.device = device + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + + # load sam model + self.sam = build_sam(checkpoint=sam_path) + self.sam.to(device=device) + self.sam_predictor = SamPredictor(self.sam) + + + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def load_image(self, image_path: str) -> Tuple[np.array, torch.Tensor]: + + + if os.path.exists(image_path): + image_source = Image.open(image_path).convert("RGB") + else: + # base64 coding + image_source = Image.open(BytesIO(base64.b64decode(image_path))).convert("RGB") + + image = np.asarray(image_source) + # image_transformed, _ = self.transform(image_source, None) + return image, None + + def generate_stream_func(self, model, params, device): + # get inputs + image_path = params["image"] + + boxes = params.get("boxes", None) # b, 4 + points = params.get("points", None) # b, n, 2 + point_labels = params.get("point_labels", None) # b, n. (1 indicates a foreground point and 0 indicates a background point.) + + assert not (boxes is None and points is None), "boxes and points cannot be both None" + assert not (boxes is not None and points is not None), "boxes and points cannot be both not None" + + image_np, _ = self.load_image(image_path) + h, w, _ = image_np.shape + + # add sam output + if boxes is not None: + if len(boxes) > 0: + boxes_tensor = torch.Tensor(boxes).to(device) + boxes_xyxy = boxes_tensor * torch.Tensor([w, h, w, h]).to(device) + self.sam_predictor.set_image(image_np) + transformed_boxes = self.sam_predictor.transform.apply_boxes_torch(boxes_xyxy, image_np.shape[:2]).to(device) + # import ipdb; ipdb.set_trace() + masks, _, _ = self.sam_predictor.predict_torch( + point_coords = None, + point_labels = None, + boxes = transformed_boxes, + multimask_output = False, + ) + masks = masks[:, 0] # B, H, W + + # encoder masks to strs + maskrls_list = [] + for mask in masks: + mask_rle = mask_util.encode(np.array(mask[:, :, None].cpu(), order="F"))[0] + mask_rle["counts"] = mask_rle["counts"].decode("utf-8") + maskrls_list.append(mask_rle) + else: + maskrls_list = [] + elif points is not None: + assert point_labels is not None, "point_labels cannot be None when points is not None" + if len(points) > 0: + points_tensor = torch.Tensor(points).to(device) * torch.Tensor([w, h]).to(device) + self.sam_predictor.set_image(image_np) + transformed_points = self.sam_predictor.transform.apply_coords_torch(points_tensor, image_np.shape[:2]).to(device) + + point_labels_tensor = torch.Tensor(point_labels).to(device) + # import ipdb; ipdb.set_trace() + masks, _, _ = self.sam_predictor.predict_torch( + point_coords = transformed_points, # b, n, 2 + point_labels = point_labels_tensor, # b, n. 1 indicates a foreground point and 0 indicates a background point. + boxes = None, + multimask_output = False, + ) + masks = masks[:, 0] # B, H, W + + # encoder masks to strs + maskrls_list = [] + for mask in masks: + mask_rle = mask_util.encode(np.array(mask[:, :, None].cpu(), order="F"))[0] + mask_rle["counts"] = mask_rle["counts"].decode("utf-8") + maskrls_list.append(mask_rle) + else: + maskrls_list = [] + + pred_dict = {} + pred_dict['masks_rle'] = maskrls_list + pred_dict['boxes'] = boxes + return pred_dict + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + None, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + @torch.inference_mode() + def get_embeddings(self, params): + try: + tokenizer = self.tokenizer + is_llama = "llama" in str( + type(self.model) + ) # vicuna support batch inference + is_chatglm = "chatglm" in str(type(self.model)) + is_t5 = "t5" in str(type(self.model)) + if is_llama: + encoding = tokenizer.batch_encode_plus( + params["input"], padding=True, return_tensors="pt" + ) + input_ids = encoding["input_ids"].to(self.device) + attention_mask = encoding["attention_mask"].to(self.device) + model_output = self.model( + input_ids, attention_mask, output_hidden_states=True + ) + data = model_output.hidden_states[-1] + mask = attention_mask.unsqueeze(-1).expand(data.size()).float() + masked_embeddings = data * mask + sum_embeddings = torch.sum(masked_embeddings, dim=1) + seq_length = torch.sum(mask, dim=1) + embedding = sum_embeddings / seq_length + normalized_embeddings = F.normalize(embedding, p=2, dim=1) + ret = { + "embedding": normalized_embeddings.tolist(), + "token_num": torch.sum(attention_mask).item(), + } + else: + embedding = [] + token_num = 0 + for text in params["input"]: + input_ids = tokenizer.encode(text, return_tensors="pt").to( + self.device + ) + if is_t5: + model_output = self.model( + input_ids, decoder_input_ids=input_ids + ) + else: + model_output = self.model(input_ids, output_hidden_states=True) + if is_chatglm: + data = (model_output.hidden_states[-1].transpose(0, 1))[0] + elif is_t5: + data = model_output.encoder_last_hidden_state[0] + else: + data = model_output.hidden_states[-1][0] + data = F.normalize(torch.mean(data, dim=0), p=2, dim=0) + embedding.append(data.tolist()) + token_num += len(input_ids[0]) + ret = { + "embedding": embedding, + "token_num": token_num, + } + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21273) + parser.add_argument("--worker-address", type=str, default="http://localhost:21273") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--sam-path", type=str, default="sam_vit_h_4b8939.pth" + ) + parser.add_argument( + "--model-names", + default="sam", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.model_names, + args.sam_path, + args.device, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/seem_test_message.py b/fin-mm/code/LLaVA-Plus/serve/seem_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..95c13eab9a41f38109b996c641ce064d0e0f5421 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/seem_test_message.py @@ -0,0 +1,113 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +import io +import numpy as np + + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "FastChat Client"} + if args.send_image: + img = load_image(args.image_path) + img_arg = encode(img) + else: + img_arg = args.image_path + datas = { + "model": model_name, + "image": img_arg, + "point": args.point, + "refimg": img_arg, + + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response) + # response is 'Response' with : + # ['_content', '_content_consumed', '_next', 'status_code', 'headers', 'raw', 'url', 'encoding', 'history', 'reason', 'cookies', 'elapsed', 'request', 'connection', '__module__', '__doc__', '__attrs__', '__init__', '__enter__', '__exit__', '__getstate__', '__setstate__', '__repr__', '__bool__', '__nonzero__', '__iter__', 'ok', 'is_redirect', 'is_permanent_redirect', 'next', 'apparent_encoding', 'iter_content', 'iter_lines', 'content', 'text', 'json', 'links', 'raise_for_status', 'close', '__dict__', '__weakref__', '__hash__', '__str__', '__getattribute__', '__setattr__', '__delattr__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__new__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__'] + + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str, default="http://localhost:21043") + parser.add_argument("--model-name", type=str, default='seem') + + # model parameters + # parser.add_argument( + # "--caption", type=str, default="dogs ." + # ) + parser.add_argument( + "--point", default=[[0.6,0.4]] + ) + parser.add_argument( + "--image_path", type=str, + ) + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/seem_worker.py b/fin-mm/code/LLaVA-Plus/serve/seem_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..8cc43ba449842316a515cac259cbf053630882aa --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/seem_worker.py @@ -0,0 +1,353 @@ +""" +A model worker executes the model. +""" +import sys, os, io + + +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid +import torchvision +import numpy as np +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +import torch +import torch.nn.functional as F +import uvicorn +from torchvision import transforms + +from modeling.BaseModel import BaseModel +from modeling import build_model +from utils.distributed import init_distributed +from utils.arguments import load_opt_from_config_files +from utils.constants import COCO_PANOPTIC_CLASSES + +from demo.seem.tasks.interactive import interactive_infer_image + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +conf_files = "configs/seem/focalt_unicl_lang_demo.yaml" +opt = load_opt_from_config_files([conf_files]) +opt = init_distributed(opt) + +def prepare_image(image_pth): + """ + apply transformation to the image. crop the image ot 640 short edge by default + """ + if os.path.exists(image_pth): + image = Image.open(image_pth).convert('RGB') + else: + image = Image.open(BytesIO(base64.b64decode(image_pth))).convert("RGB") + + return image + + +def prepare_mask(image_pth): + """ + apply transformation to the image. crop the image ot 640 short edge by default + """ + if os.path.exists(image_pth): + image = Image.open(image_pth).convert('RGBA') + else: + image = Image.open(BytesIO(base64.b64decode(image_pth))).convert("RGBA") + + return image + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + model_path, + model_type, + model_names + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + if model_path.endswith("/"): + model_path = model_path[:-1] + + + logger.info(f"Loading the model on worker {worker_id} ...") + self.model_path = model_path + self.model_type = model_type + self.model_names = model_names + + # load model + self.model = self.build_model() + + + + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + + def build_model(self): + # META DATA + cur_model = 'None' + if 'focalt' in conf_files: + pretrained_pth = os.path.join("seem_focalt_v0.pt") + if not os.path.exists(pretrained_pth): + os.system("wget {}".format( + "https://huggingface.co/xdecoder/SEEM/resolve/main/seem_focalt_v0.pt")) + cur_model = 'Focal-T' + elif 'focal' in conf_files: + pretrained_pth = os.path.join("seem_focall_v0.pt") + if not os.path.exists(pretrained_pth): + os.system("wget {}".format( + "https://huggingface.co/xdecoder/SEEM/resolve/main/seem_focall_v0.pt")) + cur_model = 'Focal-L' + + ''' + build model + ''' + model = BaseModel(opt, build_model(opt)).from_pretrained( + pretrained_pth).eval().cuda() + with torch.no_grad(): + model.model.sem_seg_head.predictor.lang_encoder.get_text_embeddings( + COCO_PANOPTIC_CLASSES + ["background"], is_eval=True) + return model + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + + def generate_stream_func(self, model_path, model_type, params): + + image_path = params["image"] + pil_image = prepare_image(image_path) + + refimg_path = params["refimg"] + pil_refimg = prepare_image(refimg_path) + + refmask_path = params["refmask"] + pil_refmask = prepare_mask(refmask_path) + + image_input = { + 'image': pil_image, + "mask": None, + } + + refimg_input = { + 'image': pil_refimg, + "mask": pil_refmask, + } + + res_img = interactive_infer_image(self.model, None, image_input, 'Example', refimg=refimg_input)[0] + + # to b64 + buffered = BytesIO() + res_img.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + + pred_dict = { + "edited_image": img_b64_str + } + + return pred_dict + + def generate_gate(self, params): + # ret = {"text": "", "error_code": 0} + # ret = self.generate_stream_func( + # self.model_path, + # self.model_type, + # params + # ) + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + self.model_path, + self.model_type, + params + ) + # except torch.cuda.OutOfMemoryError as e: + # ret = { + # "text": f"{SERVER_ERROR_MSG}\n\n({e})", + # "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + # } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21043) + parser.add_argument("--worker-address", type=str, default="http://localhost:21043") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-path", type=str, default="/comp_robot/lifeng/code/Semantic-SAM-worker/ckp/swint_only_sam_many2many.pth" + ) + parser.add_argument( + "--model-type", type=str, default="T" + ) + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.model_path, + args.model_type, + ['seem'] + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/semantic_sam_worker.py b/fin-mm/code/LLaVA-Plus/serve/semantic_sam_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..cae4e0a5931614b7acf5472d33e2ef97d9e71ba6 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/semantic_sam_worker.py @@ -0,0 +1,308 @@ +""" +A model worker executes the model. +""" +import sys, os, io + +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from semantic_sam import plot_multi_results, build_semantic_sam, SemanticSAMPredictor + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid +import torchvision +import numpy as np +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +import torch +import torch.nn.functional as F +import uvicorn +from torchvision import transforms + + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +def prepare_image(image_pth): + """ + apply transformation to the image. crop the image ot 640 short edge by default + """ + if os.path.exists(image_pth): + image = Image.open(image_pth).convert('RGB') + else: + image = Image.open(BytesIO(base64.b64decode(image_pth))).convert("RGB") + t = [] + t.append(transforms.Resize(640, interpolation=Image.BICUBIC)) + transform1 = transforms.Compose(t) + image_ori = transform1(image) + + image_ori = np.asarray(image_ori) + images = torch.from_numpy(image_ori.copy()).permute(2, 0, 1).cuda() + + return image_ori, images + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + model_path, + model_type, + model_names + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + if model_path.endswith("/"): + model_path = model_path[:-1] + + + logger.info(f"Loading the model on worker {worker_id} ...") + self.model_path = model_path + self.model_type = model_type + self.model_names = model_names + + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + + def generate_stream_func(self,model_path,model_type, params): + # get inputs + if 'point' in params: + point_prompt = params["point"] + else: + assert 'boxes' in params + box_prompt = params["boxes"] + # centers + point_prompt = [] + for box in box_prompt: + point_prompt.append([(box[0]+box[2])/2, (box[1]+box[3])/2]) + image_path = params["image"] + model_type = model_type + model_ckpt = model_path + # model_name = params["model"] + + # load image and run models + original_image, input_image = prepare_image(image_path) # change the image path to your image + mask_generator = SemanticSAMPredictor(build_semantic_sam(model_type=model_type, ckpt=model_ckpt)) # model_type: 'L' / 'T', depends on your checkpint + iou_sort_masks, area_sort_masks = mask_generator.predict_masks(original_image, input_image, point=point_prompt) # input point [[w, h]] relative location, i.e, [[0.5, 0.5]] is the center of the image + + # 创建一个BytesIO对象,用于临时存储图像数据 + image_data = io.BytesIO() + sum_0=np.array(iou_sort_masks[0]).sum() + sum_1=np.array(iou_sort_masks[1]).sum() + mask_List = [] + # 将图像保存到BytesIO对象中,格式为JPEG + for mask in iou_sort_masks : + image_data = io.BytesIO() + mask.save(image_data, format='JPEG') + # 将BytesIO对象的内容转换为字节串 + image_data_bytes = image_data.getvalue() + # 将图像数据编码为Base64字符串 + encoded_image = base64.b64encode(image_data_bytes).decode('utf-8') + + mask_List.append(encoded_image) + + pred_dict = { + "iou_sort_masks": mask_List + } + + return pred_dict + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + self.model_path, + self.model_type, + params + ) + # except torch.cuda.OutOfMemoryError as e: + # ret = { + # "text": f"{SERVER_ERROR_MSG}\n\n({e})", + # "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + # } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21004) + parser.add_argument("--worker-address", type=str, default="http://localhost:21004") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-path", type=str, default="/comp_robot/lifeng/code/Semantic-SAM-worker/ckp/swint_only_sam_many2many.pth" + ) + parser.add_argument( + "--model-type", type=str, default="T" + ) + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.model_path, + args.model_type, + ['semantic_sam', 'semantic-sam'] + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/stablediffusion_test_message.py b/fin-mm/code/LLaVA-Plus/serve/stablediffusion_test_message.py new file mode 100644 index 0000000000000000000000000000000000000000..7609e2742ae6c32172e5f75af221ddced623c55b --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/stablediffusion_test_message.py @@ -0,0 +1,104 @@ +"""Send a test message.""" +import argparse +import json +import time +from io import BytesIO +import cv2 +import numpy as np + + +import requests +from PIL import Image +import base64 + +import torch +import torchvision.transforms.functional as F + +def load_image(image_path): + img = Image.open(image_path).convert('RGB') + # import ipdb; ipdb.set_trace() + # resize if needed + w, h = img.size + if max(h, w) > 800: + if h > w: + new_h = 800 + new_w = int(w * 800 / h) + else: + new_w = 800 + new_h = int(h * 800 / w) + # import ipdb; ipdb.set_trace() + img = F.resize(img, (new_h, new_w)) + return img + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def main(): + model_name = args.model_name + + if args.worker_address: + worker_addr = args.worker_address + else: + controller_addr = args.controller_address + ret = requests.post(controller_addr + "/refresh_all_workers") + ret = requests.post(controller_addr + "/list_models") + models = ret.json()["models"] + models.sort() + print(f"Models: {models}") + + ret = requests.post( + controller_addr + "/get_worker_address", json={"model": model_name} + ) + worker_addr = ret.json()["address"] + print(f"worker_addr: {worker_addr}") + + if worker_addr == "": + print(f"No available workers for {model_name}") + return + + headers = {"User-Agent": "GSAM Client"} + datas = { + "model": model_name, + "prompt": "a photo of a cat" + } + tic = time.time() + response = requests.post( + worker_addr + "/worker_generate", + headers=headers, + json=datas, + ) + toc = time.time() + print(f"Time: {toc - tic:.3f}s") + + print("detection result:") + print(response.json()) + res = response.json() + + image = Image.open(BytesIO(base64.b64decode(res['edited_image']))).convert("RGB") + # save + image.save("demo2_edited2.jpg") + + + + + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + # worker parameters + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + parser.add_argument("--worker-address", type=str) + parser.add_argument("--model-name", type=str, default='sd') + + parser.add_argument( + "--send_image", action="store_true", + ) + args = parser.parse_args() + + main() diff --git a/fin-mm/code/LLaVA-Plus/serve/stablediffusion_worker.py b/fin-mm/code/LLaVA-Plus/serve/stablediffusion_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..c35593a991d30eca07f860b1dfb403ccd8afa4da --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/stablediffusion_worker.py @@ -0,0 +1,303 @@ +""" +A model worker executes the model. +""" +import sys, os +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) + +import argparse +import asyncio +import dataclasses +import logging +import json +import os +import sys +import time +from typing import List, Tuple, Union +import threading +import uuid + +from io import BytesIO +import base64 + +from fastapi import FastAPI, Request, BackgroundTasks +from fastapi.responses import StreamingResponse, JSONResponse +import numpy as np +import requests +from PIL import Image + +from diffusers import StableDiffusionPipeline, EulerAncestralDiscreteScheduler + +try: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LlamaTokenizer, + AutoModel, + ) +except ImportError: + from transformers import ( + AutoTokenizer, + AutoModelForCausalLM, + LLaMATokenizer, + AutoModel, + ) +from transformers import AutoProcessor, Blip2ForConditionalGeneration + +import torch +import torch.nn.functional as F +import uvicorn + +from serve.constants import WORKER_HEART_BEAT_INTERVAL, ErrorCode, SERVER_ERROR_MSG +from serve.utils import build_logger, pretty_print_semaphore + +GB = 1 << 30 + + +now_file_name = os.__file__ +logdir = "logs/workers/" +os.makedirs(logdir, exist_ok=True) +logfile = os.path.join(logdir, f"{now_file_name}.log") + +worker_id = str(uuid.uuid4())[:6] +logger = build_logger(now_file_name, logfile) +global_counter = 0 + +model_semaphore = None + +def encode(image: Image): + buffered = BytesIO() + image.save(buffered, format="JPEG") + img_b64_str = base64.b64encode(buffered.getvalue()).decode() + return img_b64_str + + +def heart_beat_worker(controller): + while True: + time.sleep(WORKER_HEART_BEAT_INTERVAL) + controller.send_heart_beat() + + +class ModelWorker: + def __init__( + self, + controller_addr, + worker_addr, + worker_id, + no_register, + model_path, + model_names, + device, + ): + self.controller_addr = controller_addr + self.worker_addr = worker_addr + self.worker_id = worker_id + self.model_names = model_names + self.device = device + + # # load model + # logger.info(f"Loading the model {self.model_names} on worker {worker_id} ...") + # self.processor = AutoProcessor.from_pretrained(model_path) + # self.model = Blip2ForConditionalGeneration.from_pretrained(model_path, torch_dtype=torch.float16) + # self.model.eval() + # self.model.to(device) + model_id = "runwayml/stable-diffusion-v1-5" + pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16) + pipe.to("cuda") + pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config) + + self.pipe = pipe + + if not no_register: + self.register_to_controller() + self.heart_beat_thread = threading.Thread( + target=heart_beat_worker, args=(self,) + ) + self.heart_beat_thread.start() + + def resize(self, image:Image, resize_w:int, resize_h:int): + image = image.resize((resize_w, resize_h)) + return image + + + def register_to_controller(self): + logger.info("Register to controller") + + url = self.controller_addr + "/register_worker" + data = { + "worker_name": self.worker_addr, + "check_heart_beat": True, + "worker_status": self.get_status(), + } + r = requests.post(url, json=data) + assert r.status_code == 200 + + def send_heart_beat(self): + logger.info( + f"Send heart beat. Models: {self.model_names}. " + f"Semaphore: {pretty_print_semaphore(model_semaphore)}. " + f"global_counter: {global_counter}. " + f"worker_id: {worker_id}. " + ) + + url = self.controller_addr + "/receive_heart_beat" + + while True: + try: + ret = requests.post( + url, + json={ + "worker_name": self.worker_addr, + "queue_length": self.get_queue_length(), + }, + timeout=5, + ) + exist = ret.json()["exist"] + break + except requests.exceptions.RequestException as e: + logger.error(f"heart beat error: {e}") + time.sleep(5) + + if not exist: + self.register_to_controller() + + def get_queue_length(self): + if ( + model_semaphore is None + or model_semaphore._value is None + or model_semaphore._waiters is None + ): + return 0 + else: + return ( + args.limit_model_concurrency + - model_semaphore._value + + len(model_semaphore._waiters) + ) + + def get_status(self): + return { + "model_names": self.model_names, + "speed": 1, + "queue_length": self.get_queue_length(), + } + + def generate_stream_func(self, model, params, device): + prompt = params["prompt"] + + # run + images = self.pipe(prompt, num_inference_steps=20).images + image = images[0] + + # save image + # images[0].save("test.jpg") + + pred_dict = { + "edited_image": encode(image), + } + + return pred_dict + + def generate_gate(self, params): + try: + + ret = {"text": "", "error_code": 0} + ret = self.generate_stream_func( + None, + params, + self.device, + ) + except torch.cuda.OutOfMemoryError as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.CUDA_OUT_OF_MEMORY, + } + except (ValueError, RuntimeError) as e: + ret = { + "text": f"{SERVER_ERROR_MSG}\n\n({e})", + "error_code": ErrorCode.INTERNAL_ERROR, + } + return ret + + + +app = FastAPI() + + +def release_model_semaphore(): + model_semaphore.release() + + +def acquire_model_semaphore(): + global model_semaphore, global_counter + global_counter += 1 + if model_semaphore is None: + model_semaphore = asyncio.Semaphore(args.limit_model_concurrency) + return model_semaphore.acquire() + + +def create_background_tasks(): + background_tasks = BackgroundTasks() + background_tasks.add_task(release_model_semaphore) + return background_tasks + + + +@app.post("/worker_generate") +async def api_generate(request: Request): + params = await request.json() + await acquire_model_semaphore() + output = worker.generate_gate(params) + release_model_semaphore() + return JSONResponse(output) + + +@app.post("/worker_get_status") +async def api_get_status(request: Request): + return worker.get_status() + + + + + +@app.post("/model_details") +async def model_details(request: Request): + return {"context_length": worker.context_len} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--host", type=str, default="localhost") + parser.add_argument("--port", type=int, default=21307) + parser.add_argument("--worker-address", type=str, default="http://localhost:21307") + parser.add_argument( + "--controller-address", type=str, default="http://localhost:21001" + ) + + parser.add_argument( + "--model-path", type=str, default="Salesforce/blip2-opt-2.7b" + ) + + parser.add_argument( + "--model-names", + default="stable-diffusion,sd", + type=lambda s: s.split(","), + help="Optional display comma separated names", + ) + parser.add_argument("--device", type=str, default="cuda") + parser.add_argument("--limit-model-concurrency", type=int, default=5) + parser.add_argument("--stream-interval", type=int, default=2) + parser.add_argument("--no-register", action="store_true") + args = parser.parse_args() + logger.info(f"args: {args}") + + + worker = ModelWorker( + args.controller_address, + args.worker_address, + worker_id, + args.no_register, + args.model_path, + args.model_names, + args.device, + ) + uvicorn.run(app, host=args.host, port=args.port, log_level="info") diff --git a/fin-mm/code/LLaVA-Plus/serve/utils.py b/fin-mm/code/LLaVA-Plus/serve/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..8f889694e956ba51cc2ca086d7043ffc802c4d80 --- /dev/null +++ b/fin-mm/code/LLaVA-Plus/serve/utils.py @@ -0,0 +1,267 @@ +""" +Common utilities. +""" +from asyncio import AbstractEventLoop +import json +import logging +import logging.handlers +import os +import platform +import sys +from typing import AsyncGenerator, Generator +import warnings + +import requests +import torch + +from serve.constants import LOGDIR + +server_error_msg = "**NETWORK ERROR DUE TO HIGH TRAFFIC. PLEASE REGENERATE OR REFRESH THIS PAGE.**" + +handler = None +visited_loggers = set() + + +def build_logger(logger_name, logger_filename): + global handler + + formatter = logging.Formatter( + fmt="%(asctime)s | %(levelname)s | %(name)s | %(message)s", + datefmt="%Y-%m-%d %H:%M:%S", + ) + + # Set the format of root handlers + if not logging.getLogger().handlers: + if sys.version_info[1] >= 9: + # This is for windows + logging.basicConfig(level=logging.INFO, encoding="utf-8") + else: + if platform.system() == "Windows": + warnings.warn( + "If you are running on Windows, " + "we recommend you use Python >= 3.9 for UTF-8 encoding." + ) + logging.basicConfig(level=logging.INFO) + logging.getLogger().handlers[0].setFormatter(formatter) + + # Redirect stdout and stderr to loggers + stdout_logger = logging.getLogger("stdout") + stdout_logger.setLevel(logging.INFO) + sl = StreamToLogger(stdout_logger, logging.INFO) + sys.stdout = sl + + stderr_logger = logging.getLogger("stderr") + stderr_logger.setLevel(logging.ERROR) + sl = StreamToLogger(stderr_logger, logging.ERROR) + sys.stderr = sl + + # Get logger + logger = logging.getLogger(logger_name) + logger.setLevel(logging.INFO) + + os.makedirs(LOGDIR, exist_ok=True) + filename = os.path.join(LOGDIR, logger_filename) + handler = logging.handlers.TimedRotatingFileHandler( + filename, when="D", utc=True, encoding="utf-8" + ) + handler.setFormatter(formatter) + + for logger in [stdout_logger, stderr_logger, logger]: + if logger in visited_loggers: + continue + visited_loggers.add(logger) + logger.addHandler(handler) + + return logger + + +class StreamToLogger(object): + """ + Fake file-like stream object that redirects writes to a logger instance. + """ + + def __init__(self, logger, log_level=logging.INFO): + self.terminal = sys.stdout + self.logger = logger + self.log_level = log_level + self.linebuf = "" + + def __getattr__(self, attr): + return getattr(self.terminal, attr) + + def write(self, buf): + temp_linebuf = self.linebuf + buf + self.linebuf = "" + for line in temp_linebuf.splitlines(True): + # From the io.TextIOWrapper docs: + # On output, if newline is None, any '\n' characters written + # are translated to the system default line separator. + # By default sys.stdout.write() expects '\n' newlines and then + # translates them so this is still cross platform. + if line[-1] == "\n": + encoded_message = line.encode("utf-8", "ignore").decode("utf-8") + self.logger.log(self.log_level, encoded_message.rstrip()) + else: + self.linebuf += line + + def flush(self): + if self.linebuf != "": + encoded_message = self.linebuf.encode("utf-8", "ignore").decode("utf-8") + self.logger.log(self.log_level, encoded_message.rstrip()) + self.linebuf = "" + + +def disable_torch_init(): + """ + Disable the redundant torch default initialization to accelerate model creation. + """ + import torch + + setattr(torch.nn.Linear, "reset_parameters", lambda self: None) + setattr(torch.nn.LayerNorm, "reset_parameters", lambda self: None) + + +def get_gpu_memory(max_gpus=None): + """Get available memory for each GPU.""" + gpu_memory = [] + num_gpus = ( + torch.cuda.device_count() + if max_gpus is None + else min(max_gpus, torch.cuda.device_count()) + ) + + for gpu_id in range(num_gpus): + with torch.cuda.device(gpu_id): + device = torch.cuda.current_device() + gpu_properties = torch.cuda.get_device_properties(device) + total_memory = gpu_properties.total_memory / (1024**3) + allocated_memory = torch.cuda.memory_allocated() / (1024**3) + available_memory = total_memory - allocated_memory + gpu_memory.append(available_memory) + return gpu_memory + + +def violates_moderation(text): + """ + Check whether the text violates OpenAI moderation API. + """ + url = "https://api.openai.com/v1/moderations" + headers = { + "Content-Type": "application/json", + "Authorization": "Bearer " + os.environ["OPENAI_API_KEY"], + } + text = text.replace("\n", "") + data = "{" + '"input": ' + f'"{text}"' + "}" + data = data.encode("utf-8") + try: + ret = requests.post(url, headers=headers, data=data, timeout=5) + flagged = ret.json()["results"][0]["flagged"] + except requests.exceptions.RequestException as e: + flagged = False + except KeyError as e: + flagged = False + + return flagged + + +def clean_flant5_ckpt(ckpt_path): + """ + Flan-t5 trained with HF+FSDP saves corrupted weights for shared embeddings, + Use this function to make sure it can be correctly loaded. + """ + index_file = os.path.join(ckpt_path, "pytorch_model.bin.index.json") + index_json = json.load(open(index_file, "r")) + + weightmap = index_json["weight_map"] + + share_weight_file = weightmap["shared.weight"] + share_weight = torch.load(os.path.join(ckpt_path, share_weight_file))[ + "shared.weight" + ] + + for weight_name in ["decoder.embed_tokens.weight", "encoder.embed_tokens.weight"]: + weight_file = weightmap[weight_name] + weight = torch.load(os.path.join(ckpt_path, weight_file)) + weight[weight_name] = share_weight + torch.save(weight, os.path.join(ckpt_path, weight_file)) + + +def pretty_print_semaphore(semaphore): + """Print a semaphore in better format.""" + if semaphore is None: + return "None" + return f"Semaphore(value={semaphore._value}, locked={semaphore.locked()})" + + +"""A javascript function to get url parameters for the gradio web server.""" +get_window_url_params_js = """ +function() { + const params = new URLSearchParams(window.location.search); + url_params = Object.fromEntries(params); + console.log("url_params", url_params); + return url_params; + } +""" + + +def iter_over_async( + async_gen: AsyncGenerator, event_loop: AbstractEventLoop +) -> Generator: + """ + Convert async generator to sync generator + + :param async_gen: the AsyncGenerator to convert + :param event_loop: the event loop to run on + :returns: Sync generator + """ + ait = async_gen.__aiter__() + + async def get_next(): + try: + obj = await ait.__anext__() + return False, obj + except StopAsyncIteration: + return True, None + + while True: + done, obj = event_loop.run_until_complete(get_next()) + if done: + break + yield obj + + +def detect_language(text: str) -> str: + """Detect the langauge of a string.""" + import polyglot # pip3 install polyglot pyicu pycld2 + from polyglot.detect import Detector + from polyglot.detect.base import logger as polyglot_logger + import pycld2 + + polyglot_logger.setLevel("ERROR") + + try: + lang_code = Detector(text).language.name + except (pycld2.error, polyglot.detect.base.UnknownLanguage): + lang_code = "unknown" + return lang_code + + +def parse_gradio_auth_creds(filename): + """Parse a username:password file for gradio authorization.""" + gradio_auth_creds = [] + with open(filename, "r", encoding="utf8") as file: + for line in file.readlines(): + gradio_auth_creds += [x.strip() for x in line.split(",") if x.strip()] + if gradio_auth_creds: + auth = [tuple(cred.split(":")) for cred in gradio_auth_creds] + else: + auth = None + return auth + + +def is_partial_stop(output, stop_str): + """Check whether the output contains a partial stop str.""" + for i in range(0, min(len(output), len(stop_str))): + if stop_str.startswith(output[-i:]): + return True + return False diff --git a/fin-mm/code/__pycache__/dataset_paired.cpython-310.pyc b/fin-mm/code/__pycache__/dataset_paired.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6a8bf979350565bab9bc7a1ff33657e6427b435c Binary files /dev/null and b/fin-mm/code/__pycache__/dataset_paired.cpython-310.pyc differ diff --git a/fin-mm/code/dataset_paired.py b/fin-mm/code/dataset_paired.py new file mode 100644 index 0000000000000000000000000000000000000000..ce4db611089a1c0b87f4654b8d9e7710461fc134 --- /dev/null +++ b/fin-mm/code/dataset_paired.py @@ -0,0 +1,242 @@ +""" +Paired Dataset Loader for Multi-Modal Training. + +Loads the paired (CSV + PNG) dataset generated by generate_paired_dataset.py. +Compatible with LLaVA+DMMV-A+DMMV-S+Kronos training pipeline. + +Output format matches TimeSeriesWithKlineDataset: + - ts: [seq_len, 5] OHLCV time series (log-transformed) + - image: [3, 336, 336] K-line chart image + - target: [pred_len] Close prices (log-transformed) +""" + +import os +import json +import pandas as pd +import numpy as np +import torch +from torch.utils.data import Dataset +from PIL import Image +from pathlib import Path + + +class PairedDataset(Dataset): + """ + Load paired time series CSV and K-line PNG for multi-modal training. + + Expects directory structure: + data_dir/ + +-- train/ + | +-- timeseries/*.csv + | +-- kline_img/*.png + | +-- samples_pred20.json + +-- val/ + +-- test/ + """ + + def __init__( + self, + data_dir: str, + mode: str = 'train', + seq_len: int = 96, + pred_len: int = 20, + max_samples: int = None, + use_log_transform: bool = True, + exclude_tickers: list = None, + include_only: list = None + ): + """ + Args: + data_dir: Path to paired_dataset directory + mode: 'train', 'val', or 'test' + seq_len: Input sequence length (should match CSV data) + pred_len: Prediction length + max_samples: Limit number of samples (for quick testing) + use_log_transform: Apply log(x+1) transform to prices + exclude_tickers: List of tickers to exclude (e.g., ['BTC-USD', 'ETH-USD']) + include_only: List of tickers to include only (e.g., ['BTC-USD', 'ETH-USD']) + """ + self.data_dir = Path(data_dir) + self.mode = mode + self.seq_len = seq_len + self.pred_len = pred_len + self.use_log_transform = use_log_transform + self.exclude_tickers = exclude_tickers or [] + self.include_only = include_only or [] + + # Load sample index + samples_file = self.data_dir / mode / f"samples_pred{pred_len}.json" + + if not samples_file.exists(): + raise FileNotFoundError(f"Samples file not found: {samples_file}") + + with open(samples_file, 'r') as f: + all_samples = json.load(f) + + # 过滤数据 + if self.include_only: + self.samples = [s for s in all_samples if s['ticker'] in self.include_only] + print(f"[PairedDataset] {mode}: {len(self.samples)} samples (仅包含{self.include_only})") + elif self.exclude_tickers: + self.samples = [s for s in all_samples if s['ticker'] not in self.exclude_tickers] + print(f"[PairedDataset] {mode}: {len(self.samples)} samples (排除{self.exclude_tickers})") + else: + self.samples = all_samples + print(f"[PairedDataset] {mode}: {len(self.samples)} samples loaded") + + # Limit samples if requested + if max_samples is not None: + self.samples = self.samples[:max_samples] + + def __len__(self): + return len(self.samples) + + def __getitem__(self, idx): + sample = self.samples[idx] + + # Load time series CSV + csv_path = self.data_dir / sample['csv_path'] + df = pd.read_csv(csv_path) + + # Extract OHLCV data + ohlcv = df[['Open', 'High', 'Low', 'Close', 'Volume']].values + + # Apply log transform (standard practice for financial data) + if self.use_log_transform: + ohlcv = np.log(ohlcv + 1) + + # Get target from sample info (already stored in manifest) + target = np.array(sample['target_close']) + if self.use_log_transform: + target = np.log(target + 1) + + # Load K-line image + png_path = self.data_dir / sample['png_path'] + try: + img = Image.open(png_path).convert('RGB') + img = img.resize((336, 336)) # LLaVA CLIP-336 + img_tensor = torch.FloatTensor(np.array(img)).permute(2, 0, 1) / 255.0 + except Exception as e: + print(f"Warning: Failed to load image {png_path}: {e}") + img_tensor = torch.zeros(3, 336, 336) + + return { + 'ts': torch.FloatTensor(ohlcv), # [96, 5] + 'image': img_tensor, # [3, 336, 336] + 'target': torch.FloatTensor(target), # [20] + 'sample_id': sample['sample_id'] # For debugging + } + + +class PairedDatasetSimple(Dataset): + """ + Simplified version without K-line images. + For testing DMMV/Kronos models without LLaVA. + """ + + def __init__( + self, + data_dir: str, + mode: str = 'train', + seq_len: int = 96, + pred_len: int = 20, + max_samples: int = None, + use_log_transform: bool = True + ): + self.data_dir = Path(data_dir) + self.mode = mode + self.seq_len = seq_len + self.pred_len = pred_len + self.use_log_transform = use_log_transform + + samples_file = self.data_dir / mode / f"samples_pred{pred_len}.json" + + if not samples_file.exists(): + raise FileNotFoundError(f"Samples file not found: {samples_file}") + + with open(samples_file, 'r') as f: + self.samples = json.load(f) + + if max_samples is not None: + self.samples = self.samples[:max_samples] + + print(f"[PairedDatasetSimple] {mode}: {len(self.samples)} samples") + + def __len__(self): + return len(self.samples) + + def __getitem__(self, idx): + sample = self.samples[idx] + + csv_path = self.data_dir / sample['csv_path'] + df = pd.read_csv(csv_path) + + ohlcv = df[['Open', 'High', 'Low', 'Close', 'Volume']].values + + if self.use_log_transform: + ohlcv = np.log(ohlcv + 1) + + target = np.array(sample['target_close']) + if self.use_log_transform: + target = np.log(target + 1) + + return torch.FloatTensor(ohlcv), torch.FloatTensor(target) + + +def test_dataset(): + """Quick test to verify dataset loading works.""" + import sys + + # Use relative path for testing + data_dir = Path(__file__).parent.parent / "data" / "paired_dataset" + + if not data_dir.exists(): + print(f"[ERROR] Data directory not found: {data_dir}") + print("Please run generate_paired_dataset.py first.") + return False + + print("=" * 60) + print("Testing PairedDataset Loading") + print("=" * 60) + + success = True + + for mode in ['train', 'val', 'test']: + try: + ds = PairedDataset(data_dir, mode=mode, max_samples=5) + + if len(ds) == 0: + print(f"[WARN] {mode}: No samples") + continue + + sample = ds[0] + + print(f"\n[{mode}] First sample:") + print(f" sample_id: {sample['sample_id']}") + print(f" ts shape: {sample['ts'].shape}") + print(f" image shape: {sample['image'].shape}") + print(f" target shape: {sample['target'].shape}") + + # Verify shapes + assert sample['ts'].shape == (96, 5), f"Expected ts shape (96, 5), got {sample['ts'].shape}" + assert sample['image'].shape == (3, 336, 336), f"Expected image shape (3, 336, 336), got {sample['image'].shape}" + assert sample['target'].shape[0] == 20, f"Expected target length 20, got {sample['target'].shape[0]}" + + print(f" [OK] Shapes verified!") + + except Exception as e: + print(f"[ERROR] {mode}: {e}") + success = False + + print("\n" + "=" * 60) + if success: + print("[SUCCESS] Dataset loading verified!") + else: + print("[FAILED] Some tests failed") + print("=" * 60) + + return success + + +if __name__ == "__main__": + test_dataset() diff --git a/fin-mm/code/eval_llm_scoring.py b/fin-mm/code/eval_llm_scoring.py new file mode 100644 index 0000000000000000000000000000000000000000..8976730cfea4cbc38992c8dfa72c2daff47df29a --- /dev/null +++ b/fin-mm/code/eval_llm_scoring.py @@ -0,0 +1,297 @@ +""" +LLM 评分脚本:评估 LLaVA 模型在 K线分析任务上的表现 +使用 NVIDIA NIM API (Llama-3.2-90b) 作为评分 LLM +""" +import json +import os +import requests +from pathlib import Path +from tqdm import tqdm +from datetime import datetime + +# ========= 配置 ========= +NIM_API_KEY = "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" +NIM_ENDPOINT = "https://integrate.api.nvidia.com/v1/chat/completions" + +# 评分模型选择(使用与数据生成不同的模型,避免偏差) +# 可选: "meta/llama-4-scout-17b-16e-instruct", "openai/gpt-oss-120b" +SCORING_MODEL = "meta/llama-4-scout-17b-16e-instruct" # Llama 4 Scout + +# 数据路径 +TEST_DATA_PATH = Path("/workspace/data/finmultitime_hf/finmultitime_kline_llavaplus_kimi_k2_test.json") +MODEL_PREDICTIONS_PATH = Path("/workspace/output/model_predictions_v3.json") +SCORING_OUTPUT_PATH = Path("/workspace/output/llm_scoring_results_v3.json") + +# ========= 评分提示模板 ========= +SCORING_PROMPT_TEMPLATE = """你是一名专业的金融技术分析评审专家。请对以下 K线图技术分析回答进行评分。 + +## 评分任务 +用户提出了一个关于股票K线图的技术分析问题,模型给出了回答。请根据以下5个维度进行评分,每个维度0-20分,总分100分。 + +## 评分维度 +1. **完整性** (0-20分): 回答是否覆盖了问题要求的所有分析维度(如趋势划分、波动分析、强度评估、转折点、未来预判等) +2. **准确性** (0-20分): 技术分析描述是否合理准确,数据引用和形态描述是否符合常识 +3. **专业性** (0-20分): 金融术语使用是否恰当(如均线、MACD、支撑位、阻力位、量价关系等) +4. **逻辑性** (0-20分): 分析推理是否有条理,因果关系是否清晰,论证是否充分 +5. **实用性** (0-20分): 交易建议是否具体可操作,风险提示是否到位 + +## 问题 +{question} + +## 模型回答 +{model_answer} + +## 参考答案(仅供参考,不必完全一致) +{reference_answer} + +## 输出格式 +请严格按以下 JSON 格式输出评分结果,不要添加任何其他内容: +```json +{{ + "completeness": <0-20>, + "accuracy": <0-20>, + "professionalism": <0-20>, + "logic": <0-20>, + "practicality": <0-20>, + "total": <0-100>, + "brief_comment": "<一句话点评>" +}} +``` +""" + + +def call_nim_scoring(prompt: str, max_retries: int = 3) -> dict: + """调用 NIM API 进行评分""" + headers = { + "Authorization": f"Bearer {NIM_API_KEY}", + "Content-Type": "application/json", + } + payload = { + "model": SCORING_MODEL, + "messages": [ + { + "role": "system", + "content": "你是一名专业的金融技术分析评审专家,请严格按照JSON格式输出评分结果。" + }, + {"role": "user", "content": prompt}, + ], + "temperature": 0.1, + "max_tokens": 512, + } + + for attempt in range(max_retries): + try: + resp = requests.post(NIM_ENDPOINT, headers=headers, json=payload, timeout=120) + resp.raise_for_status() + content = resp.json()["choices"][0]["message"]["content"].strip() + + # 解析 JSON + # 尝试从回复中提取 JSON + if "```json" in content: + json_str = content.split("```json")[1].split("```")[0].strip() + elif "```" in content: + json_str = content.split("```")[1].split("```")[0].strip() + else: + json_str = content + + scores = json.loads(json_str) + return scores + + except Exception as e: + print(f" Attempt {attempt + 1} failed: {e}") + if attempt == max_retries - 1: + return { + "completeness": 0, + "accuracy": 0, + "professionalism": 0, + "logic": 0, + "practicality": 0, + "total": 0, + "brief_comment": f"评分失败: {str(e)}", + "error": True + } + return None + + +def score_single_sample(sample: dict, model_prediction: str) -> dict: + """对单个样本进行评分""" + question = sample["conversations"][0]["value"] + reference_answer = sample["conversations"][1]["value"] + + prompt = SCORING_PROMPT_TEMPLATE.format( + question=question, + model_answer=model_prediction, + reference_answer=reference_answer + ) + + scores = call_nim_scoring(prompt) + scores["sample_id"] = sample["id"] + scores["task_type"] = sample.get("task_type", "unknown") + scores["difficulty"] = sample.get("difficulty", "unknown") + + return scores + + +def run_scoring(predictions: dict, test_data: list, resume_from: dict = None): + """运行评分流程""" + results = resume_from if resume_from else {"scores": [], "summary": {}} + scored_ids = {s["sample_id"] for s in results["scores"]} + + pending_samples = [s for s in test_data if s["id"] not in scored_ids] + print(f"\n已评分: {len(scored_ids)}, 待评分: {len(pending_samples)}") + + for sample in tqdm(pending_samples, desc="LLM Scoring"): + sample_id = sample["id"] + + if sample_id not in predictions: + print(f"\n Warning: No prediction for {sample_id}, skipping") + continue + + model_pred = predictions[sample_id] + scores = score_single_sample(sample, model_pred) + results["scores"].append(scores) + + # 每10个样本保存一次 + if len(results["scores"]) % 10 == 0: + save_results(results) + + # 计算汇总统计 + calculate_summary(results) + save_results(results) + + return results + + +def calculate_summary(results: dict): + """计算评分汇总""" + scores = [s for s in results["scores"] if not s.get("error")] + + if not scores: + results["summary"] = {"error": "No valid scores"} + return + + # 总体统计 + total_scores = [s["total"] for s in scores] + results["summary"] = { + "total_samples": len(scores), + "avg_total": sum(total_scores) / len(total_scores), + "min_total": min(total_scores), + "max_total": max(total_scores), + "dimensions": {} + } + + # 各维度统计 + for dim in ["completeness", "accuracy", "professionalism", "logic", "practicality"]: + dim_scores = [s[dim] for s in scores] + results["summary"]["dimensions"][dim] = { + "avg": sum(dim_scores) / len(dim_scores), + "min": min(dim_scores), + "max": max(dim_scores) + } + + # 按任务类型统计 + results["summary"]["by_task_type"] = {} + for task_type in set(s["task_type"] for s in scores): + task_scores = [s["total"] for s in scores if s["task_type"] == task_type] + results["summary"]["by_task_type"][task_type] = { + "count": len(task_scores), + "avg": sum(task_scores) / len(task_scores) + } + + # 按难度统计 + results["summary"]["by_difficulty"] = {} + for diff in set(s["difficulty"] for s in scores): + diff_scores = [s["total"] for s in scores if s["difficulty"] == diff] + results["summary"]["by_difficulty"][diff] = { + "count": len(diff_scores), + "avg": sum(diff_scores) / len(diff_scores) + } + + +def save_results(results: dict): + """保存评分结果""" + SCORING_OUTPUT_PATH.parent.mkdir(parents=True, exist_ok=True) + with open(SCORING_OUTPUT_PATH, "w", encoding="utf-8") as f: + json.dump(results, f, ensure_ascii=False, indent=2) + + +def print_summary(results: dict): + """打印评分汇总""" + summary = results.get("summary", {}) + + print("\n" + "=" * 60) + print("📊 LLM 评分结果汇总") + print("=" * 60) + + print(f"\n📈 总体评分:") + print(f" 样本数: {summary.get('total_samples', 0)}") + print(f" 平均分: {summary.get('avg_total', 0):.2f} / 100") + print(f" 最高分: {summary.get('max_total', 0)}") + print(f" 最低分: {summary.get('min_total', 0)}") + + print(f"\n📋 各维度平均分 (满分20):") + dims = summary.get("dimensions", {}) + for dim, stats in dims.items(): + dim_cn = { + "completeness": "完整性", + "accuracy": "准确性", + "professionalism": "专业性", + "logic": "逻辑性", + "practicality": "实用性" + }.get(dim, dim) + print(f" {dim_cn}: {stats['avg']:.2f}") + + print(f"\n📂 按任务类型:") + for task, stats in summary.get("by_task_type", {}).items(): + print(f" {task}: {stats['avg']:.2f} (n={stats['count']})") + + print(f"\n🎯 按难度:") + for diff, stats in summary.get("by_difficulty", {}).items(): + print(f" {diff}: {stats['avg']:.2f} (n={stats['count']})") + + print("\n" + "=" * 60) + + +def main(): + print("=" * 60) + print("🚀 LLM 评分脚本启动") + print(f"⏰ 时间: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}") + print("=" * 60) + + # 1. 加载测试数据 + print(f"\n📂 加载测试数据: {TEST_DATA_PATH}") + with open(TEST_DATA_PATH, "r", encoding="utf-8") as f: + test_data = json.load(f) + print(f" 测试样本数: {len(test_data)}") + + # 2. 加载模型预测结果 + print(f"\n📂 加载模型预测: {MODEL_PREDICTIONS_PATH}") + if not MODEL_PREDICTIONS_PATH.exists(): + print(" ❌ 预测文件不存在!请先运行模型推理生成预测结果。") + print(" 提示: 使用 generate_predictions.py 生成预测") + return + + with open(MODEL_PREDICTIONS_PATH, "r", encoding="utf-8") as f: + predictions = json.load(f) + print(f" 预测样本数: {len(predictions)}") + + # 3. 加载已有评分结果(断点续跑) + resume_from = None + if SCORING_OUTPUT_PATH.exists(): + with open(SCORING_OUTPUT_PATH, "r", encoding="utf-8") as f: + resume_from = json.load(f) + print(f"\n📂 发现已有评分结果: {len(resume_from.get('scores', []))} 条") + + # 4. 运行评分 + print("\n🔄 开始 LLM 评分...") + results = run_scoring(predictions, test_data, resume_from) + + # 5. 打印汇总 + print_summary(results) + + print(f"\n✅ 评分完成!结果已保存到: {SCORING_OUTPUT_PATH}") + + +if __name__ == "__main__": + main() + diff --git a/fin-mm/code/expand_paired_dataset.py b/fin-mm/code/expand_paired_dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..bb530c0a7f12d3ed44cf5eb7178623e65ab87e09 --- /dev/null +++ b/fin-mm/code/expand_paired_dataset.py @@ -0,0 +1,212 @@ +""" +扩展配对数据集脚本 +目标: 从3,033样本扩展到约10,000样本 + +方法: +1. 扩展时间范围: 2010-2025 (从2018扩展到2010) +2. 减小滑动步长: 5天 → 3天 +3. 保持7只股票不变 + +使用: + cd /workspace/Finance/fin-mm + python code/expand_paired_dataset.py +""" + +import os +import json +import pandas as pd +import numpy as np +from datetime import datetime, timedelta +from pathlib import Path +import mplfinance as mpf +from PIL import Image +import warnings +warnings.filterwarnings('ignore') + +# 配置 +CONFIG = { + 'input_days': 96, # 输入窗口 + 'pred_days': 20, # 预测窗口 + 'stride': 3, # 滑动步长(从5减到3) + 'train_end': '2023-06-30', + 'val_end': '2024-06-30', + 'tickers': ['SPY', 'AAPL', 'MSFT', 'GOOGL', 'AMZN', 'TSLA', 'NVDA', 'META', 'BTC-USD', 'ETH-USD'], # 扩展到10只 + 'data_start': '2010-01-01', # 扩展起始时间 + 'data_end': '2025-12-31', +} + +# 路径 +BASE_DIR = Path('/workspace/Finance/fin-mm' if os.path.exists('/workspace') else '/home/amd/yueyuan/Finance/fin-mm') +DATA_DIR = BASE_DIR / 'data' +YAHOO_DIR = DATA_DIR / 'yahoo' +OUTPUT_DIR = DATA_DIR / 'paired_dataset_v2' # 新的输出目录 + +def load_yahoo_data(ticker): + """加载Yahoo数据""" + csv_path = YAHOO_DIR / f'{ticker}_1d.csv' + if not csv_path.exists(): + print(f" ⚠️ {ticker} 数据不存在,跳过") + return None + + df = pd.read_csv(csv_path, parse_dates=['Date']) + df = df.sort_values('Date').reset_index(drop=True) + + # 确保有足够的数据 + df = df[df['Date'] >= CONFIG['data_start']] + + print(f" {ticker}: {len(df)} 天数据 ({df['Date'].min().date()} ~ {df['Date'].max().date()})") + return df + +def generate_kline_image(df_window, output_path): + """生成K线图PNG""" + df_plot = df_window.copy() + df_plot.set_index('Date', inplace=True) + + # K线图样式 + style = mpf.make_mpf_style( + base_mpf_style='charles', + rc={'font.size': 8} + ) + + # 保存K线图 + mpf.plot( + df_plot, + type='candle', + volume=True, + style=style, + savefig=dict(fname=str(output_path), dpi=100, bbox_inches='tight'), + figsize=(12, 6) + ) + +def generate_samples(ticker, df, split, output_base): + """为单个股票生成样本""" + samples = [] + + # 确定时间范围 + if split == 'train': + df_split = df[df['Date'] <= CONFIG['train_end']] + elif split == 'val': + df_split = df[(df['Date'] > CONFIG['train_end']) & (df['Date'] <= CONFIG['val_end'])] + else: # test + df_split = df[df['Date'] > CONFIG['val_end']] + + if len(df_split) < CONFIG['input_days'] + CONFIG['pred_days']: + return samples + + # 创建输出目录 + ts_dir = output_base / split / 'timeseries' + img_dir = output_base / split / 'kline_img' + ts_dir.mkdir(parents=True, exist_ok=True) + img_dir.mkdir(parents=True, exist_ok=True) + + # 滑动窗口生成样本 + total_days = len(df_split) + window_size = CONFIG['input_days'] + CONFIG['pred_days'] + + for start_idx in range(0, total_days - window_size + 1, CONFIG['stride']): + end_idx = start_idx + window_size + + window = df_split.iloc[start_idx:end_idx].reset_index(drop=True) + input_window = window.iloc[:CONFIG['input_days']] + target_window = window.iloc[CONFIG['input_days']:] + + # 样本ID + start_date = input_window['Date'].iloc[0].strftime('%Y%m%d') + end_date = input_window['Date'].iloc[-1].strftime('%Y%m%d') + sample_id = f"{ticker}_{start_date}_{end_date}" + + # 保存时序CSV + csv_path = ts_dir / f"{sample_id}.csv" + input_window.to_csv(csv_path, index=False) + + # 生成K线图 + png_path = img_dir / f"{sample_id}.png" + try: + generate_kline_image(input_window, png_path) + except Exception as e: + # 如果生成失败,创建空白图 + img = Image.new('RGB', (1200, 600), color='white') + img.save(png_path) + + # 样本元数据 + sample = { + 'sample_id': sample_id, + 'ticker': ticker, + 'split': split, + 'input_start': input_window['Date'].iloc[0].strftime('%Y-%m-%d'), + 'input_end': input_window['Date'].iloc[-1].strftime('%Y-%m-%d'), + 'input_days': CONFIG['input_days'], + 'target_start': target_window['Date'].iloc[0].strftime('%Y-%m-%d'), + 'target_end': target_window['Date'].iloc[-1].strftime('%Y-%m-%d'), + 'target_days': CONFIG['pred_days'], + 'target_close': [float(x) for x in target_window['Close'].tolist()], # 确保是float + 'csv_path': f"{split}/timeseries/{sample_id}.csv", + 'png_path': f"{split}/kline_img/{sample_id}.png" + } + samples.append(sample) + + return samples + +def main(): + print("=" * 70) + print("扩展配对数据集") + print(f"目标: 从3,033样本扩展到约10,000样本") + print(f"方法: 滑动步长 5→3, 时间范围扩展") + print("=" * 70) + + # 创建输出目录 + OUTPUT_DIR.mkdir(parents=True, exist_ok=True) + + # 加载所有股票数据 + print("\n📊 加载Yahoo数据...") + stock_data = {} + for ticker in CONFIG['tickers']: + df = load_yahoo_data(ticker) + if df is not None: + stock_data[ticker] = df + + # 生成样本 + all_samples = {'train': [], 'val': [], 'test': []} + + print("\n🔧 生成配对样本...") + for ticker, df in stock_data.items(): + print(f"\n处理 {ticker}...") + for split in ['train', 'val', 'test']: + samples = generate_samples(ticker, df, split, OUTPUT_DIR) + all_samples[split].extend(samples) + print(f" {split}: {len(samples)} 样本") + + # 保存manifest + manifest = { + 'config': CONFIG, + 'created': datetime.now().strftime('%Y-%m-%d %H:%M:%S'), + 'splits': all_samples + } + + manifest_path = OUTPUT_DIR / 'manifest_pred20.json' + with open(manifest_path, 'w') as f: + json.dump(manifest, f, indent=2) + + # 保存各split的samples文件(兼容旧版dataset_paired.py) + for split in ['train', 'val', 'test']: + split_dir = OUTPUT_DIR / split + samples_file = split_dir / 'samples_pred20.json' + with open(samples_file, 'w') as f: + json.dump(all_samples[split], f, indent=2) + print(f"✅ {split} samples保存: {samples_file}") + + # 统计 + print("\n" + "=" * 70) + print("📊 生成统计") + print("=" * 70) + total = 0 + for split in ['train', 'val', 'test']: + count = len(all_samples[split]) + total += count + print(f"{split:8s}: {count:6d} 样本") + print(f"{'总计':8s}: {total:6d} 样本") + print(f"\n✅ Manifest保存: {manifest_path}") + print("=" * 70) + +if __name__ == '__main__': + main() diff --git a/fin-mm/code/finmme_raw_builder.py b/fin-mm/code/finmme_raw_builder.py new file mode 100644 index 0000000000000000000000000000000000000000..95227717b127c900c98cda69037d5b414e1a4a78 --- /dev/null +++ b/fin-mm/code/finmme_raw_builder.py @@ -0,0 +1,133 @@ +# finmme_raw_builder.py +from __future__ import annotations +from typing import List, Dict, Any, Literal, Optional +from pydantic import BaseModel, Field +from pathlib import Path +from tqdm import tqdm +from datasets import load_dataset +import json +import math + +# ====== 路径配置 ====== +FINMME_IMAGE_ROOT = Path("/workspace/data/finmme/images") +FINMME_RAW_JSONL = Path("/workspace/data/finmme_raw.jsonl") + + +class FinMMERawItem(BaseModel): + """ + FINMME train split 的标准化 raw 结构。 + """ + id: str + image_path: str + + question: str + options: List[str] + answer: str + question_type: Literal["single_choice", "multi_choice", "calculation", "other"] + + caption: Optional[str] = None + description: Optional[str] = None + + unit: Optional[str] = None + tolerance: Optional[float] = None + + extra: Dict[str, Any] = Field(default_factory=dict) + +class FinMMERawItem(BaseModel): + id: str + image_path: str + question: str + options: List[str] + answer: str + question_type: str + caption: Optional[str] = None + description: Optional[str] = None + # 允许三种情况:字符串(如 "percentage")、数值(如 5.0)、None + unit: Optional[str] = None + tolerance: Optional[float | str] = None + extra: Dict[str, Any] = Field(default_factory=dict) + +def split_options(option_str: str) -> List[str]: + """ + 把 "A: ...\\nB: ...\\nC: ...\\nD: ..." 拆成 ["A: ...", "B: ...", ...] + """ + lines = [l.strip() for l in option_str.split("\n") if l.strip()] + return lines + + +def question_type_to_enum(qtype: str) -> str: + """ + 映射 question_type 字段。 + """ + qtype = (qtype or "").strip().lower() + if qtype in {"single_choice", "single"}: + return "single_choice" + if qtype in {"multi_choice", "multiple_choice", "multi"}: + return "multi_choice" + if qtype in {"calculation", "numeric", "cal"}: + return "calculation" + return "other" + + +def build_finmme_raw_from_hf( + split: str = "train", + image_root: Path = FINMME_IMAGE_ROOT, + out_path: Path = FINMME_RAW_JSONL, +) -> None: + """ + 从 HuggingFace luojunyu/FinMME 读取数据, + 保存图片到本地,标准化为 FinMMERawItem,并写为 JSONL。 + """ + ds = load_dataset("luojunyu/FinMME", split=split) + + image_root.mkdir(parents=True, exist_ok=True) + out_path.parent.mkdir(parents=True, exist_ok=True) + + with out_path.open("w", encoding="utf-8") as f_out: + for row in tqdm(ds, desc=f"Building FINMME raw [{split}]"): + try: + # 1. 保存图片到本地 + pil_img = row["image"] + img_filename = f"finmme_{split}_{row['id']}.png" + img_path = image_root / img_filename + pil_img.save(img_path) + + # 2. 选项 + options_list = split_options(row["options"]) + + # 3. 答案统一为大写 + answer = str(row["answer"]).strip().upper() + + # 4. 容差 + tol_raw = row.get("tolerance", None) + tolerance = None + if tol_raw is not None and not (isinstance(tol_raw, float) and math.isnan(tol_raw)): + try: + tolerance = float(tol_raw) + except Exception: + tolerance = None + + raw_item = FinMMERawItem( + id=str(row["id"]), + image_path=str(img_path), + question=row["question_text"], + options=options_list, + answer=answer, + question_type=question_type_to_enum(row.get("question_type", "other")), + caption=row.get("verified_caption"), + description=row.get("related_sentences"), + unit=row.get("unit") or None, + tolerance=tolerance, + extra={}, + ) + except Exception: + continue + + f_out.write(raw_item.model_dump_json(ensure_ascii=False) + "\n") + + print(f"[FINMME] Raw JSONL saved to: {out_path}") + print(f"[FINMME] Images saved under: {image_root}") + + +if __name__ == "__main__": + build_finmme_raw_from_hf(split="train") diff --git a/fin-mm/code/finmme_to_llava.py b/fin-mm/code/finmme_to_llava.py new file mode 100644 index 0000000000000000000000000000000000000000..43b0576edc1bcb92ca3209c6f4f8a67f3d0b062a --- /dev/null +++ b/fin-mm/code/finmme_to_llava.py @@ -0,0 +1,90 @@ +# finmme_to_llava.py +from __future__ import annotations +from typing import List, Literal +from pydantic import BaseModel, Field, ConfigDict +from pathlib import Path +import json +from tqdm import tqdm + +# 复用 builder 中的定义,避免类型不一致 +from finmme_raw_builder import FinMMERawItem, FINMME_RAW_JSONL + + +OUT_LLAVA_JSONL = Path("/workspace/data/finmme_llava_train.jsonl") + + +class ConversationTurn(BaseModel): + model_config = ConfigDict(validate_by_name=True) + + from_: Literal["human", "gpt"] = Field(alias="from") + value: str + + +class LlavaSample(BaseModel): + id: str + image: str + conversations: List[ConversationTurn] + + +def load_finmme_raw(path: Path) -> List[FinMMERawItem]: + items: List[FinMMERawItem] = [] + with path.open("r", encoding="utf-8") as f: + for line in f: + line = line.strip() + if not line: + continue + obj = json.loads(line) + items.append(FinMMERawItem(**obj)) + return items + + +def finmme_to_llava(item: FinMMERawItem) -> LlavaSample: + """ + 直接使用 FINMME 的英文/中文内容,不改语言: + - human: + 原始 question + 原始 options + - gpt: 用简单前缀 + 原始 answer + 原始 description/caption + """ + + # human 侧:不加中文“选项:”,直接拼 question + options + human_lines = [ + "", + item.question, # 原始提问语言 + "", + *item.options, # 原始选项语言 + ] + human_value = "\n".join(human_lines) + + # gpt 侧:answer 和 explanation 也保持原始语言(英文样本就全英文) + explanation = item.description or item.caption or "" + gpt_value_lines = [ + f"Answer: {item.answer}." + ] + if explanation: + gpt_value_lines.append(f"Explanation: {explanation}") + gpt_value = "\n".join(gpt_value_lines) + + sample = LlavaSample( + id=str(item.id), + image=item.image_path, + conversations=[ + ConversationTurn(**{"from": "human", "value": human_value}), + ConversationTurn(**{"from": "gpt", "value": gpt_value}), + ], + ) + return sample + + +def main(): + raw_items = load_finmme_raw(FINMME_RAW_JSONL) + + OUT_LLAVA_JSONL.parent.mkdir(parents=True, exist_ok=True) + with OUT_LLAVA_JSONL.open("w", encoding="utf-8") as f: + for it in tqdm(raw_items, desc="Converting FINMME to LLaVA format"): + sample = finmme_to_llava(it) + f.write(sample.model_dump_json(by_alias=True, ensure_ascii=False) + "\n") + + print(f"[FINMME] LLaVA 格式数据集已保存到: {OUT_LLAVA_JSONL}") + + +if __name__ == "__main__": + main() diff --git a/fin-mm/code/fix_manifest_paths.py b/fin-mm/code/fix_manifest_paths.py new file mode 100644 index 0000000000000000000000000000000000000000..3e52c5adb1a1c883111b959951a1e1e343b681d2 --- /dev/null +++ b/fin-mm/code/fix_manifest_paths.py @@ -0,0 +1,21 @@ +"""Fix Windows path separators in manifest file for Linux compatibility.""" +import json + +manifest_path = '/home/amd/yueyuan/Finance/fin-mm/data/paired_dataset/manifest_pred20.json' + +with open(manifest_path, 'r', encoding='utf-8') as f: + data = json.load(f) + +count = 0 +for split_name in data['splits']: + for sample in data['splits'][split_name]: + if '\\' in sample['csv_path']: + sample['csv_path'] = sample['csv_path'].replace('\\', '/') + count += 1 + if '\\' in sample['png_path']: + sample['png_path'] = sample['png_path'].replace('\\', '/') + +with open(manifest_path, 'w', encoding='utf-8') as f: + json.dump(data, f, indent=2) + +print(f"Fixed {count} paths in manifest!") diff --git a/fin-mm/code/generate_kline_images.py b/fin-mm/code/generate_kline_images.py new file mode 100644 index 0000000000000000000000000000000000000000..887ef538041bbeaa46050cee50cc0850eb1d8400 --- /dev/null +++ b/fin-mm/code/generate_kline_images.py @@ -0,0 +1,372 @@ +""" +Candlestick Chart Generator for LLaVA-Plus Multi-Modal Fusion. + +Generates K-line (candlestick) charts from OHLCV time series data using +a sliding window approach. Charts are aligned with the input window of +prediction tasks. + +Key Features: + - Sliding window generation with configurable stride + - Resolution: 336x336 (matches LLaVA ViT-L/14-336) + - Stride control to balance data coverage and storage + +Prediction Task Alignment: + - pred5: 96 days input -> 5 days prediction + - pred20: 96 days input -> 20 days prediction + - pred60: 120 days input -> 60 days prediction + +Storage Estimation (per ticker): + - stride=1: ~2,800 images × 75KB = ~210 MB + - stride=5: ~560 images × 75KB = ~42 MB (recommended) + - stride=20: ~140 images × 75KB = ~10.5 MB +""" + +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.dates as mdates +from matplotlib.patches import Rectangle +from pathlib import Path +from datetime import datetime +import argparse +import warnings +warnings.filterwarnings('ignore') + +# ============================================================================= +# Configuration +# ============================================================================= + +# Directories +DATA_DIR = Path("data/yahoo") +OUTPUT_DIR = Path("data/yahoo_kline_images") + +# Image settings (LLaVA ViT-L/14-336 requirement) +FIGSIZE = (3.36, 3.36) # inches +DPI = 100 # 3.36 * 100 = 336 pixels + +# Prediction task configurations +TASKS = { + "pred5": {"input_days": 96, "pred_days": 5}, + "pred20": {"input_days": 96, "pred_days": 20}, + "pred60": {"input_days": 120, "pred_days": 60}, +} + +# Default stride (every N days generate one chart) +DEFAULT_STRIDE = 5 # ~5 trading days = 1 week + +# Chart style +COLORS = { + 'up': '#26A69A', # Green for bullish + 'down': '#EF5350', # Red for bearish + 'background': 'white', + 'grid': '#E0E0E0', +} + + +# ============================================================================= +# Candlestick Drawing (Custom Implementation) +# ============================================================================= + +def draw_candlestick(ax, df: pd.DataFrame): + """ + Draw candlestick chart on matplotlib axes. + + Args: + ax: Matplotlib axes object + df: DataFrame with Open, High, Low, Close columns + """ + width = 0.6 + width2 = 0.1 + + for idx, (i, row) in enumerate(df.iterrows()): + open_price = row['Open'] + close_price = row['Close'] + high_price = row['High'] + low_price = row['Low'] + + # Determine color + if close_price >= open_price: + color = COLORS['up'] + bottom = open_price + height = close_price - open_price + else: + color = COLORS['down'] + bottom = close_price + height = open_price - close_price + + # Draw candle body + rect = Rectangle( + (idx - width/2, bottom), width, height, + facecolor=color, edgecolor=color, linewidth=0.5 + ) + ax.add_patch(rect) + + # Draw wicks (high-low line) + ax.plot([idx, idx], [low_price, high_price], + color=color, linewidth=0.8) + + # Set x-axis limits + ax.set_xlim(-1, len(df)) + + # Set y-axis limits with padding + y_min = df['Low'].min() + y_max = df['High'].max() + y_range = y_max - y_min + ax.set_ylim(y_min - 0.05 * y_range, y_max + 0.05 * y_range) + + +def generate_kline_image(df: pd.DataFrame, output_path: Path, + show_volume: bool = False) -> bool: + """ + Generate a single candlestick chart image. + + Args: + df: DataFrame with OHLCV data for the window + output_path: Path to save the image + show_volume: Whether to include volume subplot + + Returns: + True if successful, False otherwise + """ + try: + if show_volume: + fig, (ax1, ax2) = plt.subplots(2, 1, figsize=FIGSIZE, + gridspec_kw={'height_ratios': [3, 1]}) + else: + fig, ax1 = plt.subplots(1, 1, figsize=FIGSIZE) + + # Set background + fig.patch.set_facecolor(COLORS['background']) + ax1.set_facecolor(COLORS['background']) + + # Draw candlesticks + draw_candlestick(ax1, df) + + # Style the chart + ax1.grid(True, alpha=0.3, color=COLORS['grid']) + ax1.set_xticks([]) + ax1.set_yticks([]) + ax1.spines['top'].set_visible(False) + ax1.spines['right'].set_visible(False) + ax1.spines['bottom'].set_visible(False) + ax1.spines['left'].set_visible(False) + + # Draw volume if requested + if show_volume: + ax2.set_facecolor(COLORS['background']) + colors = [COLORS['up'] if df.iloc[i]['Close'] >= df.iloc[i]['Open'] + else COLORS['down'] for i in range(len(df))] + ax2.bar(range(len(df)), df['Volume'], color=colors, width=0.6) + ax2.set_xlim(-1, len(df)) + ax2.set_xticks([]) + ax2.set_yticks([]) + ax2.spines['top'].set_visible(False) + ax2.spines['right'].set_visible(False) + ax2.spines['bottom'].set_visible(False) + ax2.spines['left'].set_visible(False) + + # Save image + plt.tight_layout(pad=0.1) + fig.savefig(output_path, dpi=DPI, bbox_inches='tight', + pad_inches=0.02, facecolor=COLORS['background']) + plt.close(fig) + + return True + + except Exception as e: + print(f" Error: {e}") + plt.close('all') + return False + + +# ============================================================================= +# Sliding Window Generation +# ============================================================================= + +def generate_sliding_window_klines( + ticker: str, + input_days: int = 96, + stride: int = DEFAULT_STRIDE, + show_volume: bool = False +) -> int: + """ + Generate candlestick charts using sliding window. + + Args: + ticker: Stock/crypto ticker symbol + input_days: Number of days in each chart (matches model input) + stride: Step size between windows (days) + show_volume: Include volume in charts + + Returns: + Number of charts generated + """ + # Load data + data_path = DATA_DIR / f"{ticker}_1d.csv" + if not data_path.exists(): + print(f" Data file not found: {data_path}") + return 0 + + df = pd.read_csv(data_path) + + # Ensure required columns + required_cols = ['Date', 'Open', 'High', 'Low', 'Close', 'Volume'] + if not all(col in df.columns for col in required_cols): + print(f" Missing required columns in {ticker}") + return 0 + + # Create output directory + output_subdir = OUTPUT_DIR / ticker / f"window{input_days}_stride{stride}" + output_subdir.mkdir(parents=True, exist_ok=True) + + # Generate charts with sliding window + total_windows = (len(df) - input_days) // stride + 1 + generated = 0 + + print(f" Generating {total_windows} charts for {ticker}...") + + for i in range(0, len(df) - input_days + 1, stride): + window_df = df.iloc[i:i + input_days].reset_index(drop=True) + + # Create filename with date range + start_date = window_df['Date'].iloc[0] + end_date = window_df['Date'].iloc[-1] + + # Clean date format for filename + start_date_str = start_date.replace('-', '') + end_date_str = end_date.replace('-', '') + + filename = f"{ticker}_{start_date_str}_{end_date_str}.png" + output_path = output_subdir / filename + + # Skip if already exists + if output_path.exists(): + generated += 1 + continue + + # Generate chart + if generate_kline_image(window_df, output_path, show_volume): + generated += 1 + + # Progress update + if generated % 100 == 0 and generated > 0: + print(f" Progress: {generated}/{total_windows}") + + return generated + + +def estimate_storage(tickers: list, input_days: int, stride: int) -> dict: + """ + Estimate storage requirements before generation. + + Args: + tickers: List of ticker symbols + input_days: Window size + stride: Step size + + Returns: + Dictionary with estimates + """ + total_charts = 0 + estimates = {} + + for ticker in tickers: + data_path = DATA_DIR / f"{ticker}_1d.csv" + if data_path.exists(): + df = pd.read_csv(data_path) + num_charts = max(0, (len(df) - input_days) // stride + 1) + estimates[ticker] = num_charts + total_charts += num_charts + + avg_size_kb = 75 # Approximate size per image + total_size_mb = (total_charts * avg_size_kb) / 1024 + + return { + 'per_ticker': estimates, + 'total_charts': total_charts, + 'estimated_size_mb': total_size_mb + } + + +# ============================================================================= +# Main Entry Point +# ============================================================================= + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Generate candlestick charts for LLaVA-Plus" + ) + parser.add_argument( + '--tickers', nargs='+', + default=['SPY', 'AAPL', 'MSFT', 'GOOGL', 'AMZN', 'BTC-USD', 'ETH-USD'], + help='Ticker symbols to process' + ) + parser.add_argument( + '--input-days', type=int, default=96, + help='Number of days per chart (default: 96 for pred5/pred20)' + ) + parser.add_argument( + '--stride', type=int, default=DEFAULT_STRIDE, + help=f'Days between windows (default: {DEFAULT_STRIDE})' + ) + parser.add_argument( + '--volume', action='store_true', + help='Include volume subplot in charts' + ) + parser.add_argument( + '--estimate-only', action='store_true', + help='Only show storage estimates, do not generate' + ) + + args = parser.parse_args() + + print("=" * 60) + print("Candlestick Chart Generator for LLaVA-Plus") + print("=" * 60) + print(f"Input window: {args.input_days} days") + print(f"Stride: {args.stride} days") + print(f"Tickers: {args.tickers}") + print(f"Include volume: {args.volume}") + print(f"Output: {OUTPUT_DIR.absolute()}") + print("=" * 60) + + # Estimate storage + estimates = estimate_storage(args.tickers, args.input_days, args.stride) + + print("\nStorage Estimates:") + for ticker, count in estimates['per_ticker'].items(): + print(f" {ticker}: {count} charts") + print(f"\nTotal: {estimates['total_charts']} charts") + print(f"Estimated size: ~{estimates['estimated_size_mb']:.1f} MB") + print("=" * 60) + + if args.estimate_only: + print("\n[Estimate only mode - no charts generated]") + exit(0) + + # Confirm before proceeding + print("\nGenerating charts...") + + # Generate charts + total_generated = 0 + for ticker in args.tickers: + print(f"\n[{args.tickers.index(ticker)+1}/{len(args.tickers)}] {ticker}") + count = generate_sliding_window_klines( + ticker=ticker, + input_days=args.input_days, + stride=args.stride, + show_volume=args.volume + ) + print(f" Generated: {count} charts") + total_generated += count + + print("\n" + "=" * 60) + print("Generation Complete!") + print("=" * 60) + print(f"Total charts: {total_generated}") + print(f"Output directory: {OUTPUT_DIR.absolute()}") + print("\nDirectory structure:") + print(f" {OUTPUT_DIR}/") + print(f" ├── AAPL/window{args.input_days}_stride{args.stride}/") + print(f" ├── MSFT/window{args.input_days}_stride{args.stride}/") + print(f" └── ...") + print("=" * 60) diff --git a/fin-mm/code/generate_paired_dataset.py b/fin-mm/code/generate_paired_dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..909136c8ae11fa05671da40127ea616c9c418fa6 --- /dev/null +++ b/fin-mm/code/generate_paired_dataset.py @@ -0,0 +1,399 @@ +""" +Paired Dataset Generator for Multi-Modal Financial Time Series Prediction. + +Generates paired (time_series_csv, kline_image_png) samples that are +precisely aligned for LLaVA + DMMV multi-modal fusion training. + +Key Guarantee: + - Each sample has EXACTLY matched time window between CSV and PNG + - Filename encodes the exact date range for verification + - Sample ID enables 1:1 correspondence during training + +Data Structure per Sample: + sample_id: AAPL_20180102_20180420 + ├── timeseries/AAPL_20180102_20180420.csv (96 days OHLCV input) + ├── kline_img/AAPL_20180102_20180420.png (96 days candlestick) + └── target: next 20 days Close prices + +Prediction Tasks: + - pred5: 96d input -> 5d prediction + - pred20: 96d input -> 20d prediction + - pred60: 120d input -> 60d prediction +""" + +import pandas as pd +from pathlib import Path +from datetime import datetime +import json +import argparse +import warnings +warnings.filterwarnings('ignore') + +# Lazy import matplotlib (only when generating images) +plt = None +Rectangle = None + +def _import_matplotlib(): + global plt, Rectangle + if plt is None: + import matplotlib.pyplot as _plt + from matplotlib.patches import Rectangle as _Rectangle + plt = _plt + Rectangle = _Rectangle + +# ============================================================================= +# Configuration +# ============================================================================= + +# Input/Output directories +DATA_DIR = Path("data/yahoo") +OUTPUT_DIR = Path("data/paired_dataset") + +# Image settings (LLaVA ViT-L/14-336) +FIGSIZE = (3.36, 3.36) +DPI = 100 # 336x336 pixels + +# Prediction task configurations +TASKS = { + "pred5": {"input_days": 96, "pred_days": 5}, + "pred10": {"input_days": 96, "pred_days": 10}, + "pred20": {"input_days": 96, "pred_days": 20}, + "pred60": {"input_days": 120, "pred_days": 60}, +} + +# Default settings +DEFAULT_TASK = "pred20" +DEFAULT_STRIDE = 5 + +# Chart colors +COLORS = { + 'up': '#26A69A', + 'down': '#EF5350', + 'background': 'white', +} + + +# ============================================================================= +# Candlestick Drawing +# ============================================================================= + +def draw_candlestick(ax, df: pd.DataFrame): + """Draw candlestick chart on axes.""" + _import_matplotlib() + width = 0.6 + + for idx in range(len(df)): + row = df.iloc[idx] + o, h, l, c = row['Open'], row['High'], row['Low'], row['Close'] + + color = COLORS['up'] if c >= o else COLORS['down'] + bottom = min(o, c) + height = abs(c - o) + + # Candle body + rect = Rectangle((idx - width/2, bottom), width, height, + facecolor=color, edgecolor=color, linewidth=0.5) + ax.add_patch(rect) + + # Wicks + ax.plot([idx, idx], [l, h], color=color, linewidth=0.8) + + ax.set_xlim(-1, len(df)) + y_min, y_max = df['Low'].min(), df['High'].max() + y_range = y_max - y_min + ax.set_ylim(y_min - 0.05 * y_range, y_max + 0.05 * y_range) + + +def generate_kline_image(df: pd.DataFrame, output_path: Path) -> bool: + """Generate candlestick image from OHLCV data.""" + _import_matplotlib() + try: + fig, ax = plt.subplots(1, 1, figsize=FIGSIZE) + fig.patch.set_facecolor(COLORS['background']) + ax.set_facecolor(COLORS['background']) + + draw_candlestick(ax, df) + + # Clean style + ax.set_xticks([]) + ax.set_yticks([]) + for spine in ax.spines.values(): + spine.set_visible(False) + ax.grid(True, alpha=0.2) + + plt.tight_layout(pad=0.1) + fig.savefig(output_path, dpi=DPI, bbox_inches='tight', + pad_inches=0.02, facecolor=COLORS['background']) + plt.close(fig) + return True + except Exception as e: + plt.close('all') + return False + + +# ============================================================================= +# Paired Dataset Generation +# ============================================================================= + +def generate_paired_samples( + ticker: str, + task: str = DEFAULT_TASK, + stride: int = DEFAULT_STRIDE, + split_ratios: dict = None +) -> dict: + """ + Generate paired (CSV, PNG) samples for a ticker. + + Args: + ticker: Stock/crypto symbol + task: Prediction task name (pred5, pred20, pred60) + stride: Days between samples + split_ratios: Train/val/test split dates + + Returns: + Dictionary with sample counts per split + """ + if split_ratios is None: + split_ratios = { + 'train': ('2018-01-01', '2022-12-31'), + 'val': ('2023-01-01', '2023-12-31'), + 'test': ('2024-01-01', '2026-12-31'), + } + + # Load data + data_path = DATA_DIR / f"{ticker}_1d.csv" + if not data_path.exists(): + print(f" [ERROR] Data not found: {data_path}") + return {} + + df = pd.read_csv(data_path) + df['Date'] = pd.to_datetime(df['Date']) + + # Get task config + task_config = TASKS.get(task, TASKS[DEFAULT_TASK]) + input_days = task_config['input_days'] + pred_days = task_config['pred_days'] + window_size = input_days + pred_days + + # Create output directories + for split in ['train', 'val', 'test']: + (OUTPUT_DIR / split / "timeseries").mkdir(parents=True, exist_ok=True) + (OUTPUT_DIR / split / "kline_img").mkdir(parents=True, exist_ok=True) + + # Track samples + sample_counts = {'train': 0, 'val': 0, 'test': 0} + sample_index = [] # For manifest file + + # Generate samples with sliding window + for i in range(0, len(df) - window_size + 1, stride): + # Extract window + input_df = df.iloc[i:i + input_days].copy() + target_df = df.iloc[i + input_days:i + window_size].copy() + + # Get date range + start_date = input_df['Date'].iloc[0] + end_date = input_df['Date'].iloc[-1] + + # Determine split based on END date of input window + split = None + for split_name, (split_start, split_end) in split_ratios.items(): + if pd.to_datetime(split_start) <= end_date <= pd.to_datetime(split_end): + split = split_name + break + + if split is None: + continue + + # Create sample ID + start_str = start_date.strftime('%Y%m%d') + end_str = end_date.strftime('%Y%m%d') + sample_id = f"{ticker}_{start_str}_{end_str}" + + # Output paths + csv_path = OUTPUT_DIR / split / "timeseries" / f"{sample_id}.csv" + png_path = OUTPUT_DIR / split / "kline_img" / f"{sample_id}.png" + + # Check if already exists + already_exists = csv_path.exists() and png_path.exists() + + if not already_exists: + # Save time series CSV (input window only) + input_df_save = input_df[['Date', 'Open', 'High', 'Low', 'Close', 'Volume']].copy() + input_df_save['Date'] = input_df_save['Date'].dt.strftime('%Y-%m-%d') + input_df_save.to_csv(csv_path, index=False) + + # Generate K-line image + if not generate_kline_image(input_df, png_path): + continue + + # Record sample info (always, even if files existed) + sample_info = { + 'sample_id': sample_id, + 'ticker': ticker, + 'split': split, + 'input_start': start_date.strftime('%Y-%m-%d'), + 'input_end': end_date.strftime('%Y-%m-%d'), + 'input_days': input_days, + 'target_start': target_df['Date'].iloc[0].strftime('%Y-%m-%d'), + 'target_end': target_df['Date'].iloc[-1].strftime('%Y-%m-%d'), + 'target_days': pred_days, + 'target_close': target_df['Close'].tolist(), + 'csv_path': str(csv_path.relative_to(OUTPUT_DIR)), + 'png_path': str(png_path.relative_to(OUTPUT_DIR)), + } + sample_index.append(sample_info) + sample_counts[split] += 1 + + return sample_counts, sample_index + + +def save_manifest(all_samples: list, task: str): + """Save manifest file with all sample information.""" + manifest = { + 'task': task, + 'task_config': TASKS[task], + 'created': datetime.now().isoformat(), + 'total_samples': len(all_samples), + 'splits': { + 'train': [s for s in all_samples if s['split'] == 'train'], + 'val': [s for s in all_samples if s['split'] == 'val'], + 'test': [s for s in all_samples if s['split'] == 'test'], + } + } + + # Save full manifest + manifest_path = OUTPUT_DIR / f"manifest_{task}.json" + with open(manifest_path, 'w') as f: + json.dump(manifest, f, indent=2) + + # Save split-specific files for easy loading + for split in ['train', 'val', 'test']: + split_samples = manifest['splits'][split] + split_path = OUTPUT_DIR / split / f"samples_{task}.json" + with open(split_path, 'w') as f: + json.dump(split_samples, f, indent=2) + + print(f"\nManifest saved: {manifest_path}") + return manifest + + +# ============================================================================= +# Main Entry Point +# ============================================================================= + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Generate paired (CSV, PNG) dataset for multi-modal training" + ) + parser.add_argument( + '--tickers', nargs='+', + default=['SPY', 'AAPL', 'MSFT', 'GOOGL', 'AMZN', 'BTC-USD', 'ETH-USD'], + help='Ticker symbols to process' + ) + parser.add_argument( + '--task', choices=['pred5', 'pred10', 'pred20', 'pred60'], default=DEFAULT_TASK, + help=f'Prediction task (default: {DEFAULT_TASK})' + ) + parser.add_argument( + '--stride', type=int, default=DEFAULT_STRIDE, + help=f'Days between samples (default: {DEFAULT_STRIDE})' + ) + parser.add_argument( + '--estimate-only', action='store_true', + help='Only estimate, do not generate' + ) + + args = parser.parse_args() + + task_config = TASKS[args.task] + + print("=" * 70) + print("Paired Dataset Generator (Time Series CSV + K-line PNG)") + print("=" * 70) + print(f"Task: {args.task}") + print(f" - Input window: {task_config['input_days']} days") + print(f" - Prediction: {task_config['pred_days']} days") + print(f"Stride: {args.stride} days") + print(f"Tickers: {args.tickers}") + print(f"Output: {OUTPUT_DIR.absolute()}") + print("=" * 70) + + # Estimate storage + print("\nEstimated samples per ticker:") + total_estimate = 0 + for ticker in args.tickers: + data_path = DATA_DIR / f"{ticker}_1d.csv" + if data_path.exists(): + df = pd.read_csv(data_path) + window = task_config['input_days'] + task_config['pred_days'] + samples = max(0, (len(df) - window) // args.stride + 1) + print(f" {ticker}: ~{samples} samples") + total_estimate += samples + + csv_size = 5 # KB per CSV + png_size = 75 # KB per PNG + total_size_mb = total_estimate * (csv_size + png_size) / 1024 + + print(f"\nTotal: ~{total_estimate} samples") + print(f"Estimated size: ~{total_size_mb:.1f} MB") + print(" - CSV files: ~{:.1f} MB".format(total_estimate * csv_size / 1024)) + print(" - PNG files: ~{:.1f} MB".format(total_estimate * png_size / 1024)) + print("=" * 70) + + if args.estimate_only: + print("\n[Estimate only - no files generated]") + exit(0) + + # Generate paired samples + print("\nGenerating paired samples...") + all_samples = [] + total_counts = {'train': 0, 'val': 0, 'test': 0} + + for idx, ticker in enumerate(args.tickers): + print(f"\n[{idx+1}/{len(args.tickers)}] Processing {ticker}...") + counts, samples = generate_paired_samples( + ticker=ticker, + task=args.task, + stride=args.stride + ) + + if counts: + for split, count in counts.items(): + total_counts[split] += count + all_samples.extend(samples) + print(f" Train: {counts.get('train', 0)}, " + f"Val: {counts.get('val', 0)}, " + f"Test: {counts.get('test', 0)}") + + # Save manifest + manifest = save_manifest(all_samples, args.task) + + # Summary + print("\n" + "=" * 70) + print("Generation Complete!") + print("=" * 70) + print(f"\nSample counts:") + print(f" Train: {total_counts['train']}") + print(f" Val: {total_counts['val']}") + print(f" Test: {total_counts['test']}") + print(f" Total: {sum(total_counts.values())}") + + print(f"\nOutput structure:") + print(f" {OUTPUT_DIR}/") + print(f" +-- train/") + print(f" | +-- timeseries/ (*.csv)") + print(f" | +-- kline_img/ (*.png)") + print(f" | +-- samples_{args.task}.json") + print(f" +-- val/") + print(f" | +-- ...") + print(f" +-- test/") + print(f" | +-- ...") + print(f" +-- manifest_{args.task}.json") + + print("\n" + "=" * 70) + print("ALIGNMENT GUARANTEE:") + print(" Each sample_id (e.g., AAPL_20180102_20180420) has:") + print(" - timeseries/AAPL_20180102_20180420.csv (96 days OHLCV)") + print(" - kline_img/AAPL_20180102_20180420.png (same 96 days chart)") + print(" [OK] Time windows are EXACTLY matched!") + print("=" * 70) diff --git a/fin-mm/code/generate_predictions.py b/fin-mm/code/generate_predictions.py new file mode 100644 index 0000000000000000000000000000000000000000..b644ec0ef07901961f25cd2481a7b96b73ac1f55 --- /dev/null +++ b/fin-mm/code/generate_predictions.py @@ -0,0 +1,209 @@ +""" +模型推理脚本:使用训练好的 LLaVA 模型对 test 集进行推理 +生成预测结果供 LLM 评分使用 +""" +import os +# 强制使用单 GPU,避免多GPU设备错误 +os.environ["CUDA_VISIBLE_DEVICES"] = "0" + +import json +import torch +from pathlib import Path +from PIL import Image +from tqdm import tqdm +from datetime import datetime + +from llava.mm_utils import process_images, tokenizer_image_token +from llava.model.builder import load_pretrained_model +from llava.conversation import conv_templates +from llava.constants import DEFAULT_IMAGE_TOKEN + +# ========= 配置 ========= +# 训练好的模型路径 (使用 train split 训练的 v3 版本) +MODEL_PATH = "/workspace/models/llava-plus-fin-kline-v1.5-7b-kimi-v3" + +# 数据路径 +TEST_DATA_PATH = Path("/workspace/data/finmultitime_hf/finmultitime_kline_llavaplus_kimi_k2_test.json") +OUTPUT_PATH = Path("/workspace/output/model_predictions_v3.json") + +# 推理参数 +MAX_NEW_TOKENS = 1024 +TEMPERATURE = 0.0 +DO_SAMPLE = False + + +def load_model(): + """加载 LLaVA 模型""" + print(f"[MODEL] Loading from {MODEL_PATH}...") + tokenizer, model, image_processor, _ = load_pretrained_model( + model_path=MODEL_PATH, + model_base=None, + model_name="llava", + ) + model = model.cuda().eval() + print("[MODEL] Loaded successfully.") + return tokenizer, model, image_processor + + +def inference_single( + tokenizer, + model, + image_processor, + prompt: str, + image_path: str +) -> str: + """对单个样本进行推理(使用v1对话模板)""" + # 加载图像 + if image_path and Path(image_path).exists(): + image = Image.open(image_path).convert("RGB") + img_tensor = process_images([image], image_processor, model.config) + img_tensor = img_tensor.to(model.device, dtype=torch.float16) + else: + img_tensor = None + + # 使用 v1 对话模板(与训练时一致) + conv = conv_templates["v1"].copy() + inp = prompt.replace("\n", "").replace("", "").strip() + + if img_tensor is not None: + conv.append_message(conv.roles[0], DEFAULT_IMAGE_TOKEN + "\n" + inp) + else: + conv.append_message(conv.roles[0], inp) + conv.append_message(conv.roles[1], None) + full_prompt = conv.get_prompt() + + # Tokenize + input_ids = tokenizer_image_token( + full_prompt, tokenizer, return_tensors="pt" + ).unsqueeze(0).to(model.device) + + # 推理 + with torch.inference_mode(): + output_ids = model.generate( + input_ids, + images=img_tensor, + max_new_tokens=MAX_NEW_TOKENS, + do_sample=DO_SAMPLE, + temperature=TEMPERATURE, + ) + + # 限制 vocab range + vocab_size = tokenizer.vocab_size + output_ids = output_ids.clone().clamp_(0, vocab_size - 1) + + # 只解码新生成的 token + new_tokens = output_ids[0][input_ids.shape[1]:] + text = tokenizer.decode(new_tokens, skip_special_tokens=True).strip() + + return text + + +def run_inference(tokenizer, model, image_processor, test_data: list, resume_from: dict = None): + """运行推理""" + import time + predictions = resume_from if resume_from else {} + + pending = [s for s in test_data if s["id"] not in predictions] + total = len(test_data) + done = len(predictions) + print(f"\n{'='*60}") + print(f"📊 推理进度: {done}/{total} ({done*100/total:.1f}%)") + print(f"⏳ 待推理: {len(pending)}") + print(f"{'='*60}\n") + + start_time = time.time() + + for i, sample in enumerate(pending): + sample_id = sample["id"] + sample_start = time.time() + + # 获取问题和图像路径 + question = sample["conversations"][0]["value"] + image_paths = sample.get("images", []) + image_path = image_paths[0] if image_paths else None + + try: + prediction = inference_single( + tokenizer, model, image_processor, + question, image_path + ) + predictions[sample_id] = prediction + status = "✅" + except Exception as e: + print(f"\n ❌ Error on {sample_id}: {e}") + predictions[sample_id] = f"[ERROR] {str(e)}" + status = "❌" + + # 计算时间 + sample_time = time.time() - sample_start + elapsed = time.time() - start_time + completed = i + 1 + avg_time = elapsed / completed + remaining = avg_time * (len(pending) - completed) + + # 每个样本都打印进度 + current_done = done + completed + print(f"[{current_done}/{total}] {status} {sample_id} | 耗时: {sample_time:.1f}s | " + f"平均: {avg_time:.1f}s | 剩余: {remaining/60:.1f}min | " + f"预测长度: {len(prediction) if status=='✅' else 0}") + + # 每5个样本保存一次 + if completed % 5 == 0: + save_predictions(predictions) + print(f" 💾 已保存 {current_done} 条预测结果") + + save_predictions(predictions) + total_time = time.time() - start_time + print(f"\n{'='*60}") + print(f"🎉 推理完成! 总耗时: {total_time/60:.1f} 分钟") + print(f"{'='*60}") + return predictions + + +def save_predictions(predictions: dict): + """保存预测结果""" + OUTPUT_PATH.parent.mkdir(parents=True, exist_ok=True) + with open(OUTPUT_PATH, "w", encoding="utf-8") as f: + json.dump(predictions, f, ensure_ascii=False, indent=2) + + +def main(): + print("=" * 60) + print("🚀 模型推理脚本启动") + print(f"⏰ 时间: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}") + print(f"📦 模型: {MODEL_PATH}") + print("=" * 60) + + # 1. 加载模型 + tokenizer, model, image_processor = load_model() + + # 2. 加载测试数据 + print(f"\n📂 加载测试数据: {TEST_DATA_PATH}") + with open(TEST_DATA_PATH, "r", encoding="utf-8") as f: + test_data = json.load(f) + print(f" 测试样本数: {len(test_data)}") + + # 3. 断点续跑 + resume_from = None + if OUTPUT_PATH.exists(): + with open(OUTPUT_PATH, "r", encoding="utf-8") as f: + resume_from = json.load(f) + print(f"\n📂 发现已有预测结果: {len(resume_from)} 条") + + # 4. 运行推理 + print("\n🔄 开始推理...") + predictions = run_inference(tokenizer, model, image_processor, test_data, resume_from) + + print(f"\n✅ 推理完成!共 {len(predictions)} 条预测") + print(f"📂 结果已保存到: {OUTPUT_PATH}") + + # 5. 展示样例 + print("\n📋 预测样例:") + for i, (sample_id, pred) in enumerate(list(predictions.items())[:2]): + print(f"\n [{sample_id}]") + print(f" 预测: {pred[:200]}...") + + +if __name__ == "__main__": + main() + diff --git a/fin-mm/code/render_candles.py b/fin-mm/code/render_candles.py new file mode 100644 index 0000000000000000000000000000000000000000..4198541cca5b7ead23b970529e70b19ae8984b17 --- /dev/null +++ b/fin-mm/code/render_candles.py @@ -0,0 +1,159 @@ +import pandas as pd +import numpy as np +from pathlib import Path +import matplotlib.pyplot as plt +from tqdm import tqdm + +# 定义输入输出路径 +RAW_DIR = Path("data/yahoo") +HIST_DIR = Path("data/charts/hist") +FULL_DIR = Path("data/charts/full") + +# 确保输出目录存在 +HIST_DIR.mkdir(parents=True, exist_ok=True) +FULL_DIR.mkdir(parents=True, exist_ok=True) + +# 窗口设置 +L_HIST = 60 # 用过去 60 天 +L_PRED = 10 # 预测未来 10 天 +IMG_SIZE = (6, 6) # 图像尺寸,英寸 + +def render_sample(df, start_idx, ticker): + end_hist = start_idx + L_HIST + end_full = end_hist + L_PRED + + # 如果数据不够长,就跳过 + if end_full > len(df): + return + + # 切片数据 + window_hist = df.iloc[start_idx:end_hist] + window_full = df.iloc[start_idx:end_full] + + # 确定统一的纵坐标范围(用完整段的最低最高价),保证两张图比例一致 + price_min = window_full["Low"].min() + price_max = window_full["High"].max() + + # 生成唯一文件名 + date_hist_start = window_hist.index[0].strftime("%Y%m%d") + date_full_end = window_full.index[-1].strftime("%Y%m%d") + sample_id = f"{ticker}_{date_hist_start}_{date_full_end}_{start_idx}" + + # --- 画图函数 --- + def plot_k_line(data, save_path, x_limit): + fig, ax = plt.subplots(figsize=IMG_SIZE) + ax.set_facecolor("white") + ax.grid(True, alpha=0.3) + + # 遍历每一行数据画 K 线 + for i, (idx, row) in enumerate(data.iterrows()): + # 涨跌颜色:收盘 >= 开盘 为绿,否则红 + color = "green" if row["Close"] >= row["Open"] else "red" + + # 画影线(最高到最低) + ax.plot([i, i], [row["Low"], row["High"]], color=color, linewidth=1) + + # 画实体(开盘到收盘的矩形) + rect_height = abs(row["Close"] - row["Open"]) + rect_bottom = min(row["Open"], row["Close"]) + # 如果开收盘价一样(十字星),给个最小高度以便显示 + if rect_height == 0: + rect_height = (price_max - price_min) * 0.002 + + ax.add_patch(plt.Rectangle((i - 0.3, rect_bottom), + 0.6, rect_height, + color=color, alpha=0.8)) + + # 设置坐标轴范围 + ax.set_xlim(-1, x_limit) + ax.set_ylim(price_min, price_max) + ax.axis("off") # 关掉坐标轴刻度,只留图形 + + plt.tight_layout() + plt.savefig(save_path, dpi=96) + plt.close(fig) + + # 1. 画历史图 (0 ~ L_HIST) + plot_k_line(window_hist, HIST_DIR / f"{sample_id}.png", L_HIST) + + # 2. 画完整图 (0 ~ L_HIST + L_PRED) + plot_k_line(window_full, FULL_DIR / f"{sample_id}.png", L_HIST + L_PRED) + +def process_one(csv_path: Path): + try: + ticker = csv_path.name.split("_")[0] + + # 1. 先整体读进来,不做 parse_dates + raw = pd.read_csv(csv_path, header=None) + + # 2. 找到哪一行是真正的列名(优先找 OHLC,找不到再找 Date) + header_row_idx = None + for i in range(min(10, len(raw))): + row_str = raw.iloc[i].astype(str).tolist() + # 检查是否包含核心价格列 + if all(c in row_str for c in ["Open", "High", "Low", "Close"]): + header_row_idx = i + break + + if header_row_idx is None: + for i in range(min(10, len(raw))): + if "Date" in raw.iloc[i].astype(str).tolist(): + header_row_idx = i + break + + if header_row_idx is None: + print(f"Cannot find header in {csv_path}") + return + + # 3. 用这一行作为列名 + raw.columns = raw.iloc[header_row_idx] + # 丢掉表头行及其之前所有行 + df = raw.iloc[header_row_idx + 1:].reset_index(drop=True) + + # 4. 只保留需要的列,并重命名 + df = df.dropna(axis=1, how="all") + # 有时 yfinance 会在列名前带个空格,统一 strip 一下 + df.columns = [str(c).strip() for c in df.columns] + + # 针对 yfinance 这种 "Price" 可能是 "Date" 的情况 + if "Date" not in df.columns and "Price" in df.columns: + df.rename(columns={"Price": "Date"}, inplace=True) + + required_cols = ["Date", "Open", "High", "Low", "Close"] + for c in required_cols: + if c not in df.columns: + raise ValueError(f"Column {c} not found in {csv_path}, columns={df.columns}") + + # 5. 解析日期并设索引 + # errors="coerce" 会把无法解析的字符串(如 "Ticker" 或 "Date" 等元数据行)变成 NaT + df["Date"] = pd.to_datetime(df["Date"], errors="coerce") + df = df.dropna(subset=["Date"]) + df.set_index("Date", inplace=True) + + # 6. 转换数值列为 float + for c in ["Open", "High", "Low", "Close"]: + df[c] = pd.to_numeric(df[c], errors="coerce") + + # 7. 清洗 + df = df.dropna(subset=["Open", "High", "Low", "Close"]) + if len(df) < L_HIST + L_PRED: + print(f"Data too short for {ticker}") + return + + print(f"Processing {ticker}...") + for start in tqdm(range(0, len(df) - L_HIST - L_PRED, L_PRED)): + render_sample(df, start, ticker) + + except Exception as e: + print(f"Error processing {csv_path}: {e}") + + +if __name__ == "__main__": + # 遍历所有下载下来的 CSV + csv_files = list(RAW_DIR.glob("*.csv")) + if not csv_files: + print("No CSV files found in data/yahoo! Please run fetch_yahoo_data.py first.") + else: + for csv in csv_files: + process_one(csv) + print("Done! Charts saved in data/charts/") diff --git a/fin-mm/code/test.py b/fin-mm/code/test.py new file mode 100644 index 0000000000000000000000000000000000000000..a42d2c77afa9a278a16469048a51898f3ec3898c --- /dev/null +++ b/fin-mm/code/test.py @@ -0,0 +1,26 @@ +from __future__ import annotations +import json +import random +from pathlib import Path +from typing import Dict, Any, List, Optional +import requests + +# ================= 基本配置 ================= +NIM_API_KEY = "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" +NIM_ENDPOINT = "https://integrate.api.nvidia.com/v1/chat/completions" +MODEL_NAME = "meta/llama-3.2-90b-vision-instruct" + +headers = { + "Authorization": f"Bearer {NIM_API_KEY}", + "Content-Type": "application/json", +} +payload = { + "model": MODEL_NAME, + "messages": [ + {"role": "user", "content": "用一句话介绍一下你自己。"} + ], + "max_tokens": 64, +} +r = requests.post(NIM_ENDPOINT, headers=headers, json=payload, timeout=30) +print(r.status_code) +print(r.text[:500]) \ No newline at end of file diff --git a/fin-mm/code/test_paired_data.py b/fin-mm/code/test_paired_data.py new file mode 100644 index 0000000000000000000000000000000000000000..3eb1b356e398c9cc3ad12f8540818778730d3469 --- /dev/null +++ b/fin-mm/code/test_paired_data.py @@ -0,0 +1,35 @@ +"""Test paired dataset loading on remote machine.""" +import json +from pathlib import Path + +DATA_DIR = Path('/home/amd/yueyuan/Finance/fin-mm/data/paired_dataset') + +print("=" * 50) +print("Testing Paired Dataset") +print("=" * 50) + +# Load manifest +manifest_path = DATA_DIR / 'manifest_pred20.json' +with open(manifest_path, 'r', encoding='utf-8') as f: + manifest = json.load(f) + +print(f"\nManifest loaded: {manifest_path}") +print(f"Train samples: {len(manifest['splits']['train'])}") +print(f"Val samples: {len(manifest['splits']['val'])}") +print(f"Test samples: {len(manifest['splits']['test'])}") + +# Check first sample +sample = manifest['splits']['train'][0] +print(f"\nFirst train sample: {sample['sample_id']}") +print(f" Input: {sample['input_start']} -> {sample['input_end']} ({sample['input_days']} days)") +print(f" Target: {sample['target_start']} -> {sample['target_end']} ({sample['target_days']} days)") + +# Verify files exist +csv_path = DATA_DIR / sample['csv_path'] +png_path = DATA_DIR / sample['png_path'] +print(f" CSV exists: {csv_path.exists()} ({csv_path})") +print(f" PNG exists: {png_path.exists()} ({png_path})") + +print("\n" + "=" * 50) +print("[SUCCESS] Dataset ready for training!") +print("=" * 50) diff --git a/fin-mm/code/yahoo_data.py b/fin-mm/code/yahoo_data.py new file mode 100644 index 0000000000000000000000000000000000000000..d1e2bf9312941bd930c877abfe6ab81e030469b7 --- /dev/null +++ b/fin-mm/code/yahoo_data.py @@ -0,0 +1,192 @@ +""" +Yahoo Finance Data Downloader for Financial Time Series Research. + +Downloads OHLCV data for external validation of prediction models. +Data is used to test generalization across different markets. + +Supported prediction tasks: + - pred5: 96 days input -> 5 days prediction + - pred20: 96 days input -> 20 days prediction + - pred60: 120 days input -> 60 days prediction +""" + +import yfinance as yf +import pandas as pd +from pathlib import Path +from datetime import datetime + +# ============================================================================= +# Configuration +# ============================================================================= + +DATA_DIR = Path("data/yahoo") +DATA_DIR.mkdir(parents=True, exist_ok=True) + +# External validation tickers (stocks only, BTC removed for fair comparison) +# BTC has different market mechanics (24/7 trading, higher volatility) +STOCK_TICKERS = [ + "SPY", # S&P 500 ETF - market benchmark + "AAPL", # Apple - tech giant + "MSFT", # Microsoft - tech giant + "GOOGL", # Alphabet - tech giant (added) + "AMZN", # Amazon - e-commerce/cloud (added) +] + +# Optional: crypto tickers for separate experiment +CRYPTO_TICKERS = [ + "BTC-USD", # Bitcoin + "ETH-USD", # Ethereum (added) +] + +# Download settings +START_DATE = "2018-01-01" # Match training data start +END_DATE = None # None = today + + +# ============================================================================= +# Download Functions +# ============================================================================= + +def download_ticker(ticker: str, interval: str = "1d", + start: str = START_DATE, end: str = None) -> pd.DataFrame: + """ + Download OHLCV data for a single ticker. + + Args: + ticker: Yahoo Finance ticker symbol + interval: Data interval (1d for daily) + start: Start date (YYYY-MM-DD) + end: End date (YYYY-MM-DD), None for today + + Returns: + DataFrame with OHLCV data + """ + print(f"Downloading {ticker}...", end=" ") + + try: + df = yf.download( + ticker, + start=start, + end=end, + interval=interval, + auto_adjust=True, + progress=False + ) + + if df.empty: + print("FAILED (empty data)") + return pd.DataFrame() + + # Flatten multi-level columns if present + if isinstance(df.columns, pd.MultiIndex): + df.columns = df.columns.get_level_values(0) + + # Ensure standard column order: Open, High, Low, Close, Volume + expected_cols = ['Open', 'High', 'Low', 'Close', 'Volume'] + df = df[expected_cols] + + # Reset index to have Date as column + df = df.reset_index() + df = df.rename(columns={'index': 'Date', 'Datetime': 'Date'}) + + # Ensure Date is in standard format + if 'Date' in df.columns: + df['Date'] = pd.to_datetime(df['Date']).dt.strftime('%Y-%m-%d') + + print(f"OK ({len(df)} days, {df['Date'].iloc[0]} to {df['Date'].iloc[-1]})") + return df + + except Exception as e: + print(f"FAILED ({e})") + return pd.DataFrame() + + +def save_data(df: pd.DataFrame, ticker: str, interval: str = "1d"): + """ + Save DataFrame to CSV with clean format. + + Args: + df: DataFrame with OHLCV data + ticker: Ticker symbol for filename + interval: Interval for filename + """ + if df.empty: + return + + out_path = DATA_DIR / f"{ticker}_{interval}.csv" + df.to_csv(out_path, index=False) + print(f" Saved: {out_path}") + + +def print_statistics(tickers: list, data_type: str = "stocks"): + """Print download statistics.""" + print(f"\n{'='*60}") + print(f"Yahoo {data_type.upper()} Data Statistics") + print(f"{'='*60}") + + total_days = 0 + for ticker in tickers: + filepath = DATA_DIR / f"{ticker}_1d.csv" + if filepath.exists(): + df = pd.read_csv(filepath) + days = len(df) + total_days += days + print(f" {ticker}: {days} days") + else: + print(f" {ticker}: NOT FOUND") + + print(f"\nTotal: {total_days} days across {len(tickers)} tickers") + + # Estimate samples for prediction tasks + min_days = (datetime.now() - datetime.strptime(START_DATE, "%Y-%m-%d")).days + print(f"\nEstimated samples per ticker:") + print(f" - pred5: 96d -> 5d = ~{max(0, min_days - 101)} samples") + print(f" - pred20: 96d -> 20d = ~{max(0, min_days - 116)} samples") + print(f" - pred60: 120d -> 60d = ~{max(0, min_days - 180)} samples") + print(f"{'='*60}") + + +# ============================================================================= +# Main Entry Point +# ============================================================================= + +if __name__ == "__main__": + import argparse + + parser = argparse.ArgumentParser(description="Download Yahoo Finance data") + parser.add_argument('--stocks-only', action='store_true', + help='Download only stock data (exclude crypto)') + parser.add_argument('--crypto-only', action='store_true', + help='Download only crypto data') + parser.add_argument('--all', action='store_true', + help='Download both stocks and crypto (default)') + args = parser.parse_args() + + print("="*60) + print("Yahoo Finance Data Downloader") + print("For Financial Time Series Research") + print("="*60) + print(f"Date range: {START_DATE} to today") + print(f"Output: {DATA_DIR.absolute()}") + print("="*60) + + # Download stocks + if not args.crypto_only: + print("\n[1/2] Downloading STOCK data...") + for ticker in STOCK_TICKERS: + df = download_ticker(ticker) + save_data(df, ticker) + print_statistics(STOCK_TICKERS, "stocks") + + # Download crypto (optional) + if not args.stocks_only: + print("\n[2/2] Downloading CRYPTO data...") + for ticker in CRYPTO_TICKERS: + df = download_ticker(ticker) + save_data(df, ticker) + print_statistics(CRYPTO_TICKERS, "crypto") + + print("\nDone!") + print("\nUsage for your research:") + print(" - Stocks (AAPL, MSFT, SPY, GOOGL, AMZN): External validation") + print(" - Crypto (BTC, ETH): Separate experiment (different market)") diff --git a/fin-mm/code/yahoo_instruction_data.py b/fin-mm/code/yahoo_instruction_data.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3408ecf92ddd2d673e6178f696e637a0dfff83 --- /dev/null +++ b/fin-mm/code/yahoo_instruction_data.py @@ -0,0 +1,198 @@ +# NVIDIA NIM 配置 (建议使用 Llama 3.2 Vision 系列) +NIM_API_KEY = "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" # <--- 替换为你的 Key +NIM_ENDPOINT = "https://integrate.api.nvidia.com/v1/chat/completions" +MODEL_NAME = "meta/llama-3.2-90b-vision-instruct" + +import os +import json +import random +import base64 +from pathlib import Path +from tqdm import tqdm +import requests + +# ================= 配置 ================= +HIST_DIR = Path("/workspace/data/charts/hist") +FULL_DIR = Path("/workspace/data/charts/full") +OUT_PATH = Path("/workspace/data/llava_fin_tool_instruct.json") + + +# 工具名,和你之后在 LLaVA-Plus 里注册的一致即可 +BAGEL_TOOL = "bagel_financial_gen" +TIMESNET_TOOL = "timesnet_forecast" +PLOT_TOOL = "plot_forecast" + + +def encode_image(image_path: str) -> str: + with open(image_path, "rb") as f: + return base64.b64encode(f.read()).decode("utf-8") + + +def call_vlm_analyze(image_path: str, ticker: str): + """ + 让 VLM 看一张历史 K 线图,输出: + 1)简短图表分析; + 2)一个合理的“用户问题”自然语言。 + """ + img_b64 = encode_image(image_path) + + prompt = f""" +你是一名擅长技术分析的量化交易员,正在观察股票 {ticker} 的历史 K 线图。 + +任务1:用 2~3 句话,用中文简要分析这张图的走势特征(例如:上涨/下跌、震荡、波动率、是否接近支撑/阻力等)。 + +任务2:基于这张图的走势,用中文写出 1 条自然的“用户问题”,向一个多模态 AI 助手询问未来走势。例如: +- 你觉得接下来10天大概率会怎么走? +- 请给出未来一段时间的可能走势场景,并提醒风险。 + +只输出下面这个 JSON 对象,不要输出其他内容: + +{{ + "analysis": "...你对图的分析...", + "user_question": "...用户会问的问题..." +}} +""" + + headers = { + "Authorization": f"Bearer {NIM_API_KEY}", + "Content-Type": "application/json", + } + + payload = { + "model": MODEL_NAME, + "messages": [ + { + "role": "user", + "content": [ + {"type": "text", "text": prompt}, + { + "type": "image_url", + "image_url": {"url": f"data:image/png;base64,{img_b64}"}, + }, + ], + } + ], + "temperature": 0.6, + "max_tokens": 512, + } + + resp = requests.post(NIM_ENDPOINT, headers=headers, json=payload, timeout=120) + if resp.status_code != 200: + print("VLM 调用失败:", resp.status_code, resp.text[:200]) + return None + + text = resp.json()["choices"][0]["message"]["content"] + + # 清理可能的 markdown 代码块 + text = text.replace("``````", "").strip() + try: + data = json.loads(text) + return data # {"analysis": "...", "user_question": "..."} + except Exception as e: + print("JSON 解析失败,返回原文用于调试:", text[:200]) + return None + + +def build_conversation(pair_id: int, hist_path: str, full_path: str, ticker: str, vlm_out: dict): + """ + 根据 VLM 的分析结果,构造一条 LLaVA-Plus 风格数据: + conversations: [human, gpt],其中 gpt 的内容是一个 JSON(thoughts/actions/value)。 + """ + analysis = vlm_out["analysis"] + user_q = vlm_out["user_question"] + + # 随机决定使用哪种工具策略 + mode = random.choice(["bagel_only", "timesnet_then_plot"]) + + if mode == "bagel_only": + thoughts = ( + f"用户想基于当前的历史走势预测未来价格路径。" + f"从图上看:{analysis}。" + f"直接调用 {BAGEL_TOOL} 生成一张包含未来走势的预测图像最合适。" + ) + actions = [ + { + "API_name": BAGEL_TOOL, + "API_params": { + "hist_image_path": hist_path, + "scenario": "中性趋势场景:延续当前走势并考虑适度波动", + }, + } + ] + value = ( + "好的,我会先用图像生成工具基于当前走势给出一幅可能的未来行情图," + "请注意这只是多种可能场景之一,不构成投资建议。" + ) + + else: + thoughts = ( + f"用户不仅想看图像,还希望了解具体的数值预测。" + f"从图上看:{analysis}。" + f"可以先调用 {TIMESNET_TOOL} 得到未来价格序列,再调用 {PLOT_TOOL} 画出预测图。" + ) + actions = [ + { + "API_name": TIMESNET_TOOL, + "API_params": {"ticker": ticker, "hist_data_points": 60, "pred_horizon": 10}, + }, + { + "API_name": PLOT_TOOL, + "API_params": {"hist_image_path": hist_path, "forecast_data": ""}, + }, + ] + value = ( + "我会先根据历史数据做一个未来10个周期的数值预测,然后把预测结果和当前K线一起画成图," + "这样你既能看到大致走势,也能看到估计的价格区间。请注意预测存在误差和风险。" + ) + + gpt_json = { + "thoughts": thoughts, + "actions": actions, + "value": value, + } + + conv = { + "id": f"fin_tool_{pair_id}", + "image": hist_path, + "conversations": [ + {"from": "human", "value": f"\n{user_q}"}, + {"from": "gpt", "value": json.dumps(gpt_json, ensure_ascii=False, indent=2)}, + ], + } + return conv + + +def main(): + # 1. 找到配对图片 + pairs = [] + hist_files = sorted(list(HIST_DIR.glob("*.png"))) + for hist in hist_files: + full = FULL_DIR / hist.name + if full.exists(): + ticker = hist.name.split("_")[0] + pairs.append((str(hist), str(full), ticker)) + + print(f"找到 {len(pairs)} 对图片。") + + OUT_PATH.parent.mkdir(parents=True, exist_ok=True) + conversations = [] + + # 为了先试跑,这里限制前 N 条;正式跑可以去掉 [:N] + for i, (hist_path, full_path, ticker) in enumerate(tqdm(pairs, desc="生成多模态指令")): + vlm_out = call_vlm_analyze(hist_path, ticker) + if not vlm_out: + continue + conv = build_conversation(i, hist_path, full_path, ticker, vlm_out) + conversations.append(conv) + + with open(OUT_PATH, "w", encoding="utf-8") as f: + json.dump(conversations, f, ensure_ascii=False, indent=2) + + print(f"完成!生成 {len(conversations)} 条指令数据 -> {OUT_PATH}") + + +if __name__ == "__main__": + if NIM_API_KEY.startswith("nvapi-xxx"): + print("请先在脚本中填写 NIM_API_KEY。") + else: + main() \ No newline at end of file diff --git a/fin-mm/data/bagel_fin/bagel_fin_edit.jsonl b/fin-mm/data/bagel_fin/bagel_fin_edit.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..0757d649b98f4b47d0150d2bc862c4489d062b67 --- /dev/null +++ b/fin-mm/data/bagel_fin/bagel_fin_edit.jsonl @@ -0,0 +1,1094 @@ +{"source_image": "/workspace/data/charts/hist/MSFT_20250213_20250523_2310.png", "target_image": "/workspace/data/charts/full/MSFT_20250213_20250523_2310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160908_20161215_190.png", "target_image": "/workspace/data/charts/full/SPY_20160908_20161215_190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230906_20231114_2830.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230906_20231114_2830.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20241129_20250313_2260.png", "target_image": "/workspace/data/charts/full/MSFT_20241129_20250313_2260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160418_20160726_90.png", "target_image": "/workspace/data/charts/full/AAPL_20160418_20160726_90.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240314_20240522_3020.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240314_20240522_3020.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170920_20171228_450.png", "target_image": "/workspace/data/charts/full/MSFT_20170920_20171228_450.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200506_20200813_1110.png", "target_image": "/workspace/data/charts/full/MSFT_20200506_20200813_1110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220723_20220930_2420.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220723_20220930_2420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180904_20181212_690.png", "target_image": "/workspace/data/charts/full/SPY_20180904_20181212_690.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170321_20170529_470.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170321_20170529_470.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160515_20160723_160.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160515_20160723_160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240612_20240820_3110.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240612_20240820_3110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240131_20240509_2050.png", "target_image": "/workspace/data/charts/full/AAPL_20240131_20240509_2050.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210509_20210717_1980.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210509_20210717_1980.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210119_20210329_1870.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210119_20210329_1870.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250328_20250709_2340.png", "target_image": "/workspace/data/charts/full/AAPL_20250328_20250709_2340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180723_20181029_660.png", "target_image": "/workspace/data/charts/full/AAPL_20180723_20181029_660.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230712_20231018_1910.png", "target_image": "/workspace/data/charts/full/SPY_20230712_20231018_1910.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220504_20220712_2340.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220504_20220712_2340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20231215_20240327_2020.png", "target_image": "/workspace/data/charts/full/AAPL_20231215_20240327_2020.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170510_20170718_520.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170510_20170718_520.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220922_20221230_1710.png", "target_image": "/workspace/data/charts/full/AAPL_20220922_20221230_1710.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20191015_20200124_970.png", "target_image": "/workspace/data/charts/full/AAPL_20191015_20200124_970.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200618_20200925_1140.png", "target_image": "/workspace/data/charts/full/SPY_20200618_20200925_1140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240328_20240709_2090.png", "target_image": "/workspace/data/charts/full/SPY_20240328_20240709_2090.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220713_20221019_1660.png", "target_image": "/workspace/data/charts/full/MSFT_20220713_20221019_1660.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210729_20211104_1420.png", "target_image": "/workspace/data/charts/full/MSFT_20210729_20211104_1420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20161006_20170117_210.png", "target_image": "/workspace/data/charts/full/AAPL_20161006_20170117_210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220317_20220627_1580.png", "target_image": "/workspace/data/charts/full/MSFT_20220317_20220627_1580.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180125_20180404_780.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180125_20180404_780.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180115_20180325_770.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180115_20180325_770.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160713_20161019_150.png", "target_image": "/workspace/data/charts/full/AAPL_20160713_20161019_150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20181002_20190111_710.png", "target_image": "/workspace/data/charts/full/MSFT_20181002_20190111_710.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200604_20200911_1130.png", "target_image": "/workspace/data/charts/full/SPY_20200604_20200911_1130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20191226_20200406_1020.png", "target_image": "/workspace/data/charts/full/AAPL_20191226_20200406_1020.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180412_20180720_590.png", "target_image": "/workspace/data/charts/full/AAPL_20180412_20180720_590.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190114_20190424_780.png", "target_image": "/workspace/data/charts/full/MSFT_20190114_20190424_780.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180505_20180713_880.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180505_20180713_880.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20221110_20230118_2530.png", "target_image": "/workspace/data/charts/full/BTC-USD_20221110_20230118_2530.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200407_20200716_1090.png", "target_image": "/workspace/data/charts/full/AAPL_20200407_20200716_1090.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20201210_20210217_1830.png", "target_image": "/workspace/data/charts/full/BTC-USD_20201210_20210217_1830.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240117_20240425_2040.png", "target_image": "/workspace/data/charts/full/AAPL_20240117_20240425_2040.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240124_20240402_2970.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240124_20240402_2970.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190819_20191125_930.png", "target_image": "/workspace/data/charts/full/MSFT_20190819_20191125_930.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170808_20171114_420.png", "target_image": "/workspace/data/charts/full/MSFT_20170808_20171114_420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230330_20230711_1840.png", "target_image": "/workspace/data/charts/full/MSFT_20230330_20230711_1840.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20201130_20210207_1820.png", "target_image": "/workspace/data/charts/full/BTC-USD_20201130_20210207_1820.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220514_20220722_2350.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220514_20220722_2350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200310_20200617_1070.png", "target_image": "/workspace/data/charts/full/MSFT_20200310_20200617_1070.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250806_20251014_3530.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250806_20251014_3530.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190212_20190522_800.png", "target_image": "/workspace/data/charts/full/AAPL_20190212_20190522_800.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200723_20200930_1690.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200723_20200930_1690.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160121_20160429_30.png", "target_image": "/workspace/data/charts/full/AAPL_20160121_20160429_30.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170822_20171129_430.png", "target_image": "/workspace/data/charts/full/MSFT_20170822_20171129_430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20241119_20250127_3270.png", "target_image": "/workspace/data/charts/full/BTC-USD_20241119_20250127_3270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210715_20211021_1410.png", "target_image": "/workspace/data/charts/full/SPY_20210715_20211021_1410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180904_20181212_690.png", "target_image": "/workspace/data/charts/full/MSFT_20180904_20181212_690.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230103_20230413_1780.png", "target_image": "/workspace/data/charts/full/AAPL_20230103_20230413_1780.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210228_20210508_1910.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210228_20210508_1910.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250610_20250918_2390.png", "target_image": "/workspace/data/charts/full/MSFT_20250610_20250918_2390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220317_20220627_1580.png", "target_image": "/workspace/data/charts/full/SPY_20220317_20220627_1580.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170103_20170412_270.png", "target_image": "/workspace/data/charts/full/SPY_20170103_20170412_270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200210_20200519_1050.png", "target_image": "/workspace/data/charts/full/MSFT_20200210_20200519_1050.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190708_20191014_900.png", "target_image": "/workspace/data/charts/full/SPY_20190708_20191014_900.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200928_20210106_1210.png", "target_image": "/workspace/data/charts/full/SPY_20200928_20210106_1210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20181111_20190119_1070.png", "target_image": "/workspace/data/charts/full/BTC-USD_20181111_20190119_1070.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220202_20220512_1550.png", "target_image": "/workspace/data/charts/full/AAPL_20220202_20220512_1550.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170110_20170320_400.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170110_20170320_400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240831_20241108_3190.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240831_20241108_3190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20201021_20201229_1780.png", "target_image": "/workspace/data/charts/full/BTC-USD_20201021_20201229_1780.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170330_20170710_330.png", "target_image": "/workspace/data/charts/full/MSFT_20170330_20170710_330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210429_20210707_1970.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210429_20210707_1970.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190331_20190608_1210.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190331_20190608_1210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170201_20170511_290.png", "target_image": "/workspace/data/charts/full/AAPL_20170201_20170511_290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20161117_20170301_240.png", "target_image": "/workspace/data/charts/full/SPY_20161117_20170301_240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160304_20160613_60.png", "target_image": "/workspace/data/charts/full/AAPL_20160304_20160613_60.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250826_20251103_3550.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250826_20251103_3550.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230612_20230920_1890.png", "target_image": "/workspace/data/charts/full/SPY_20230612_20230920_1890.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190313_20190620_820.png", "target_image": "/workspace/data/charts/full/SPY_20190313_20190620_820.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220524_20220801_2360.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220524_20220801_2360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20221130_20230207_2550.png", "target_image": "/workspace/data/charts/full/BTC-USD_20221130_20230207_2550.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160713_20161019_150.png", "target_image": "/workspace/data/charts/full/MSFT_20160713_20161019_150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200703_20200910_1670.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200703_20200910_1670.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230907_20231214_1950.png", "target_image": "/workspace/data/charts/full/MSFT_20230907_20231214_1950.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170907_20171115_640.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170907_20171115_640.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20191001_20200109_960.png", "target_image": "/workspace/data/charts/full/SPY_20191001_20200109_960.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20171229_20180411_520.png", "target_image": "/workspace/data/charts/full/SPY_20171229_20180411_520.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230215_20230525_1810.png", "target_image": "/workspace/data/charts/full/MSFT_20230215_20230525_1810.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230809_20231115_1930.png", "target_image": "/workspace/data/charts/full/SPY_20230809_20231115_1930.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180806_20181112_670.png", "target_image": "/workspace/data/charts/full/AAPL_20180806_20181112_670.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160824_20161201_180.png", "target_image": "/workspace/data/charts/full/MSFT_20160824_20161201_180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180228_20180607_560.png", "target_image": "/workspace/data/charts/full/SPY_20180228_20180607_560.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230215_20230525_1810.png", "target_image": "/workspace/data/charts/full/SPY_20230215_20230525_1810.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20171004_20180112_460.png", "target_image": "/workspace/data/charts/full/MSFT_20171004_20180112_460.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240811_20241019_3170.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240811_20241019_3170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20231005_20240116_1970.png", "target_image": "/workspace/data/charts/full/SPY_20231005_20240116_1970.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210616_20210923_1390.png", "target_image": "/workspace/data/charts/full/AAPL_20210616_20210923_1390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170316_20170623_320.png", "target_image": "/workspace/data/charts/full/MSFT_20170316_20170623_320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240910_20241118_3200.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240910_20241118_3200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180524_20180831_620.png", "target_image": "/workspace/data/charts/full/SPY_20180524_20180831_620.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210812_20211118_1430.png", "target_image": "/workspace/data/charts/full/AAPL_20210812_20211118_1430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190430_20190708_1240.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190430_20190708_1240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250428_20250806_2360.png", "target_image": "/workspace/data/charts/full/AAPL_20250428_20250806_2360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250213_20250523_2310.png", "target_image": "/workspace/data/charts/full/SPY_20250213_20250523_2310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240702_20240909_3130.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240702_20240909_3130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180803_20181011_970.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180803_20181011_970.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230215_20230525_1810.png", "target_image": "/workspace/data/charts/full/AAPL_20230215_20230525_1810.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190808_20191016_1340.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190808_20191016_1340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20221020_20230131_1730.png", "target_image": "/workspace/data/charts/full/AAPL_20221020_20230131_1730.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200422_20200730_1100.png", "target_image": "/workspace/data/charts/full/SPY_20200422_20200730_1100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240610_20240918_2140.png", "target_image": "/workspace/data/charts/full/MSFT_20240610_20240918_2140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20171027_20180104_690.png", "target_image": "/workspace/data/charts/full/BTC-USD_20171027_20180104_690.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20161101_20170109_330.png", "target_image": "/workspace/data/charts/full/BTC-USD_20161101_20170109_330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200731_20201106_1170.png", "target_image": "/workspace/data/charts/full/SPY_20200731_20201106_1170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20201208_20210319_1260.png", "target_image": "/workspace/data/charts/full/MSFT_20201208_20210319_1260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200613_20200821_1650.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200613_20200821_1650.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200901_20201109_1730.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200901_20201109_1730.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20181113_20190226_740.png", "target_image": "/workspace/data/charts/full/SPY_20181113_20190226_740.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200325_20200602_1570.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200325_20200602_1570.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20161012_20161220_310.png", "target_image": "/workspace/data/charts/full/BTC-USD_20161012_20161220_310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210330_20210607_1940.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210330_20210607_1940.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200717_20201023_1160.png", "target_image": "/workspace/data/charts/full/SPY_20200717_20201023_1160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20171216_20180223_740.png", "target_image": "/workspace/data/charts/full/BTC-USD_20171216_20180223_740.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250724_20251030_2420.png", "target_image": "/workspace/data/charts/full/SPY_20250724_20251030_2420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20181030_20190211_730.png", "target_image": "/workspace/data/charts/full/MSFT_20181030_20190211_730.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250821_20251128_2440.png", "target_image": "/workspace/data/charts/full/SPY_20250821_20251128_2440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20241031_20250212_2240.png", "target_image": "/workspace/data/charts/full/AAPL_20241031_20250212_2240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180525_20180802_900.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180525_20180802_900.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20241230_20250410_2280.png", "target_image": "/workspace/data/charts/full/MSFT_20241230_20250410_2280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210409_20210617_1950.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210409_20210617_1950.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190917_20191224_950.png", "target_image": "/workspace/data/charts/full/MSFT_20190917_20191224_950.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220331_20220712_1590.png", "target_image": "/workspace/data/charts/full/SPY_20220331_20220712_1590.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200214_20200423_1530.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200214_20200423_1530.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240117_20240425_2040.png", "target_image": "/workspace/data/charts/full/MSFT_20240117_20240425_2040.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170612_20170919_380.png", "target_image": "/workspace/data/charts/full/AAPL_20170612_20170919_380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210122_20210503_1290.png", "target_image": "/workspace/data/charts/full/SPY_20210122_20210503_1290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190917_20191224_950.png", "target_image": "/workspace/data/charts/full/SPY_20190917_20191224_950.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240314_20240624_2080.png", "target_image": "/workspace/data/charts/full/MSFT_20240314_20240624_2080.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20151207_20160317_0.png", "target_image": "/workspace/data/charts/full/SPY_20151207_20160317_0.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240131_20240509_2050.png", "target_image": "/workspace/data/charts/full/MSFT_20240131_20240509_2050.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200424_20200702_1600.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200424_20200702_1600.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160824_20161201_180.png", "target_image": "/workspace/data/charts/full/SPY_20160824_20161201_180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230618_20230826_2750.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230618_20230826_2750.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160810_20161116_170.png", "target_image": "/workspace/data/charts/full/SPY_20160810_20161116_170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240223_20240502_3000.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240223_20240502_3000.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170301_20170509_450.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170301_20170509_450.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250807_20251113_2430.png", "target_image": "/workspace/data/charts/full/SPY_20250807_20251113_2430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250724_20251030_2420.png", "target_image": "/workspace/data/charts/full/AAPL_20250724_20251030_2420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20171115_20180227_490.png", "target_image": "/workspace/data/charts/full/SPY_20171115_20180227_490.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20151221_20160401_10.png", "target_image": "/workspace/data/charts/full/MSFT_20151221_20160401_10.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20171018_20180129_470.png", "target_image": "/workspace/data/charts/full/MSFT_20171018_20180129_470.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180912_20181120_1010.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180912_20181120_1010.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20171229_20180411_520.png", "target_image": "/workspace/data/charts/full/MSFT_20171229_20180411_520.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220613_20220921_1640.png", "target_image": "/workspace/data/charts/full/MSFT_20220613_20220921_1640.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210926_20211204_2120.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210926_20211204_2120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230612_20230920_1890.png", "target_image": "/workspace/data/charts/full/MSFT_20230612_20230920_1890.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20191015_20200124_970.png", "target_image": "/workspace/data/charts/full/MSFT_20191015_20200124_970.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230302_20230609_1820.png", "target_image": "/workspace/data/charts/full/SPY_20230302_20230609_1820.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230718_20230925_2780.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230718_20230925_2780.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20201012_20210121_1220.png", "target_image": "/workspace/data/charts/full/MSFT_20201012_20210121_1220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190114_20190424_780.png", "target_image": "/workspace/data/charts/full/AAPL_20190114_20190424_780.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160516_20160823_110.png", "target_image": "/workspace/data/charts/full/MSFT_20160516_20160823_110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190530_20190807_1270.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190530_20190807_1270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20181022_20181230_1050.png", "target_image": "/workspace/data/charts/full/BTC-USD_20181022_20181230_1050.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170725_20171031_410.png", "target_image": "/workspace/data/charts/full/MSFT_20170725_20171031_410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20181128_20190312_750.png", "target_image": "/workspace/data/charts/full/MSFT_20181128_20190312_750.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170215_20170525_300.png", "target_image": "/workspace/data/charts/full/MSFT_20170215_20170525_300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20191017_20191225_1410.png", "target_image": "/workspace/data/charts/full/BTC-USD_20191017_20191225_1410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220414_20220726_1600.png", "target_image": "/workspace/data/charts/full/SPY_20220414_20220726_1600.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210924_20220103_1460.png", "target_image": "/workspace/data/charts/full/AAPL_20210924_20220103_1460.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180405_20180613_850.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180405_20180613_850.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250807_20251113_2430.png", "target_image": "/workspace/data/charts/full/MSFT_20250807_20251113_2430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160614_20160921_130.png", "target_image": "/workspace/data/charts/full/AAPL_20160614_20160921_130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20201110_20210118_1800.png", "target_image": "/workspace/data/charts/full/BTC-USD_20201110_20210118_1800.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240722_20240929_3150.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240722_20240929_3150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240807_20241113_2180.png", "target_image": "/workspace/data/charts/full/SPY_20240807_20241113_2180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160106_20160415_20.png", "target_image": "/workspace/data/charts/full/MSFT_20160106_20160415_20.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230103_20230413_1780.png", "target_image": "/workspace/data/charts/full/MSFT_20230103_20230413_1780.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170120_20170330_410.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170120_20170330_410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220824_20221201_1690.png", "target_image": "/workspace/data/charts/full/MSFT_20220824_20221201_1690.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160505_20160713_150.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160505_20160713_150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170201_20170511_290.png", "target_image": "/workspace/data/charts/full/MSFT_20170201_20170511_290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160628_20161005_140.png", "target_image": "/workspace/data/charts/full/SPY_20160628_20161005_140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200814_20201120_1180.png", "target_image": "/workspace/data/charts/full/AAPL_20200814_20201120_1180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220824_20221201_1690.png", "target_image": "/workspace/data/charts/full/SPY_20220824_20221201_1690.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200506_20200813_1110.png", "target_image": "/workspace/data/charts/full/AAPL_20200506_20200813_1110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250905_20251113_3560.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250905_20251113_3560.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220908_20221215_1700.png", "target_image": "/workspace/data/charts/full/SPY_20220908_20221215_1700.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240724_20241030_2170.png", "target_image": "/workspace/data/charts/full/AAPL_20240724_20241030_2170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210519_20210727_1990.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210519_20210727_1990.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170725_20171031_410.png", "target_image": "/workspace/data/charts/full/SPY_20170725_20171031_410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240905_20241212_2200.png", "target_image": "/workspace/data/charts/full/AAPL_20240905_20241212_2200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20211022_20220201_1480.png", "target_image": "/workspace/data/charts/full/AAPL_20211022_20220201_1480.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210308_20210615_1320.png", "target_image": "/workspace/data/charts/full/AAPL_20210308_20210615_1320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170619_20170827_560.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170619_20170827_560.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200127_20200505_1040.png", "target_image": "/workspace/data/charts/full/AAPL_20200127_20200505_1040.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220824_20221201_1690.png", "target_image": "/workspace/data/charts/full/AAPL_20220824_20221201_1690.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220216_20220526_1560.png", "target_image": "/workspace/data/charts/full/AAPL_20220216_20220526_1560.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160415_20160623_130.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160415_20160623_130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20231116_20240228_2000.png", "target_image": "/workspace/data/charts/full/MSFT_20231116_20240228_2000.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180213_20180523_550.png", "target_image": "/workspace/data/charts/full/SPY_20180213_20180523_550.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220119_20220428_1540.png", "target_image": "/workspace/data/charts/full/SPY_20220119_20220428_1540.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170711_20171017_400.png", "target_image": "/workspace/data/charts/full/AAPL_20170711_20171017_400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20181213_20190326_760.png", "target_image": "/workspace/data/charts/full/AAPL_20181213_20190326_760.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20201026_20210204_1230.png", "target_image": "/workspace/data/charts/full/AAPL_20201026_20210204_1230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230728_20231005_2790.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230728_20231005_2790.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190719_20190926_1320.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190719_20190926_1320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170311_20170519_460.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170311_20170519_460.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180608_20180917_630.png", "target_image": "/workspace/data/charts/full/AAPL_20180608_20180917_630.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190129_20190508_790.png", "target_image": "/workspace/data/charts/full/SPY_20190129_20190508_790.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180709_20181015_650.png", "target_image": "/workspace/data/charts/full/MSFT_20180709_20181015_650.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190410_20190618_1220.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190410_20190618_1220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180918_20181227_700.png", "target_image": "/workspace/data/charts/full/AAPL_20180918_20181227_700.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180228_20180607_560.png", "target_image": "/workspace/data/charts/full/AAPL_20180228_20180607_560.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200520_20200827_1120.png", "target_image": "/workspace/data/charts/full/MSFT_20200520_20200827_1120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180724_20181001_960.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180724_20181001_960.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240214_20240523_2060.png", "target_image": "/workspace/data/charts/full/MSFT_20240214_20240523_2060.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200315_20200523_1560.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200315_20200523_1560.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240131_20240509_2050.png", "target_image": "/workspace/data/charts/full/SPY_20240131_20240509_2050.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240821_20241127_2190.png", "target_image": "/workspace/data/charts/full/MSFT_20240821_20241127_2190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250710_20251016_2410.png", "target_image": "/workspace/data/charts/full/AAPL_20250710_20251016_2410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190819_20191125_930.png", "target_image": "/workspace/data/charts/full/AAPL_20190819_20191125_930.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20201208_20210319_1260.png", "target_image": "/workspace/data/charts/full/SPY_20201208_20210319_1260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20171017_20171225_680.png", "target_image": "/workspace/data/charts/full/BTC-USD_20171017_20171225_680.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20181128_20190312_750.png", "target_image": "/workspace/data/charts/full/SPY_20181128_20190312_750.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20241109_20250117_3260.png", "target_image": "/workspace/data/charts/full/BTC-USD_20241109_20250117_3260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230330_20230607_2670.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230330_20230607_2670.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230512_20230822_1870.png", "target_image": "/workspace/data/charts/full/AAPL_20230512_20230822_1870.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240710_20241016_2160.png", "target_image": "/workspace/data/charts/full/MSFT_20240710_20241016_2160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170330_20170710_330.png", "target_image": "/workspace/data/charts/full/SPY_20170330_20170710_330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20231102_20240213_1990.png", "target_image": "/workspace/data/charts/full/SPY_20231102_20240213_1990.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20211006_20211214_2130.png", "target_image": "/workspace/data/charts/full/BTC-USD_20211006_20211214_2130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240426_20240806_2110.png", "target_image": "/workspace/data/charts/full/MSFT_20240426_20240806_2110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20181002_20190111_710.png", "target_image": "/workspace/data/charts/full/SPY_20181002_20190111_710.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220911_20221119_2470.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220911_20221119_2470.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20161231_20170310_390.png", "target_image": "/workspace/data/charts/full/BTC-USD_20161231_20170310_390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250727_20251004_3520.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250727_20251004_3520.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20201123_20210305_1250.png", "target_image": "/workspace/data/charts/full/MSFT_20201123_20210305_1250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170410_20170618_490.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170410_20170618_490.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180622_20181001_640.png", "target_image": "/workspace/data/charts/full/SPY_20180622_20181001_640.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20231005_20240116_1970.png", "target_image": "/workspace/data/charts/full/MSFT_20231005_20240116_1970.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230109_20230319_2590.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230109_20230319_2590.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240807_20241113_2180.png", "target_image": "/workspace/data/charts/full/MSFT_20240807_20241113_2180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250128_20250407_3340.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250128_20250407_3340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200310_20200617_1070.png", "target_image": "/workspace/data/charts/full/SPY_20200310_20200617_1070.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20201109_20210219_1240.png", "target_image": "/workspace/data/charts/full/MSFT_20201109_20210219_1240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20171116_20180124_710.png", "target_image": "/workspace/data/charts/full/BTC-USD_20171116_20180124_710.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170215_20170525_300.png", "target_image": "/workspace/data/charts/full/AAPL_20170215_20170525_300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20211225_20220304_2210.png", "target_image": "/workspace/data/charts/full/BTC-USD_20211225_20220304_2210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210628_20210905_2030.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210628_20210905_2030.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180604_20180812_910.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180604_20180812_910.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240314_20240624_2080.png", "target_image": "/workspace/data/charts/full/SPY_20240314_20240624_2080.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210419_20210627_1960.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210419_20210627_1960.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160908_20161215_190.png", "target_image": "/workspace/data/charts/full/MSFT_20160908_20161215_190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230316_20230626_1830.png", "target_image": "/workspace/data/charts/full/SPY_20230316_20230626_1830.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220901_20221109_2460.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220901_20221109_2460.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240314_20240624_2080.png", "target_image": "/workspace/data/charts/full/AAPL_20240314_20240624_2080.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200105_20200314_1490.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200105_20200314_1490.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220713_20221019_1660.png", "target_image": "/workspace/data/charts/full/AAPL_20220713_20221019_1660.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240801_20241009_3160.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240801_20241009_3160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20161202_20170315_250.png", "target_image": "/workspace/data/charts/full/SPY_20161202_20170315_250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20191126_20200203_1450.png", "target_image": "/workspace/data/charts/full/BTC-USD_20191126_20200203_1450.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20201222_20210405_1270.png", "target_image": "/workspace/data/charts/full/SPY_20201222_20210405_1270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220713_20221019_1660.png", "target_image": "/workspace/data/charts/full/SPY_20220713_20221019_1660.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170428_20170807_350.png", "target_image": "/workspace/data/charts/full/AAPL_20170428_20170807_350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240403_20240611_3040.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240403_20240611_3040.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250527_20250904_2380.png", "target_image": "/workspace/data/charts/full/MSFT_20250527_20250904_2380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200914_20201221_1200.png", "target_image": "/workspace/data/charts/full/AAPL_20200914_20201221_1200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20191112_20200224_990.png", "target_image": "/workspace/data/charts/full/MSFT_20191112_20200224_990.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190509_20190816_860.png", "target_image": "/workspace/data/charts/full/AAPL_20190509_20190816_860.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20211206_20220316_1510.png", "target_image": "/workspace/data/charts/full/AAPL_20211206_20220316_1510.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160531_20160907_120.png", "target_image": "/workspace/data/charts/full/SPY_20160531_20160907_120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190227_20190606_810.png", "target_image": "/workspace/data/charts/full/SPY_20190227_20190606_810.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20201123_20210305_1250.png", "target_image": "/workspace/data/charts/full/SPY_20201123_20210305_1250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250915_20251123_3570.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250915_20251123_3570.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240324_20240601_3030.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240324_20240601_3030.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170612_20170919_380.png", "target_image": "/workspace/data/charts/full/SPY_20170612_20170919_380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190629_20190906_1300.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190629_20190906_1300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220921_20221129_2480.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220921_20221129_2480.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20241229_20250308_3310.png", "target_image": "/workspace/data/charts/full/BTC-USD_20241229_20250308_3310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240919_20241227_2210.png", "target_image": "/workspace/data/charts/full/MSFT_20240919_20241227_2210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20171018_20180129_470.png", "target_image": "/workspace/data/charts/full/SPY_20171018_20180129_470.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230201_20230511_1800.png", "target_image": "/workspace/data/charts/full/SPY_20230201_20230511_1800.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160727_20161102_160.png", "target_image": "/workspace/data/charts/full/AAPL_20160727_20161102_160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20231116_20240228_2000.png", "target_image": "/workspace/data/charts/full/SPY_20231116_20240228_2000.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160418_20160726_90.png", "target_image": "/workspace/data/charts/full/SPY_20160418_20160726_90.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20191216_20200223_1470.png", "target_image": "/workspace/data/charts/full/BTC-USD_20191216_20200223_1470.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190819_20191125_930.png", "target_image": "/workspace/data/charts/full/SPY_20190819_20191125_930.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160810_20161116_170.png", "target_image": "/workspace/data/charts/full/MSFT_20160810_20161116_170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220317_20220627_1580.png", "target_image": "/workspace/data/charts/full/AAPL_20220317_20220627_1580.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230512_20230822_1870.png", "target_image": "/workspace/data/charts/full/MSFT_20230512_20230822_1870.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240412_20240723_2100.png", "target_image": "/workspace/data/charts/full/SPY_20240412_20240723_2100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20161216_20170329_260.png", "target_image": "/workspace/data/charts/full/SPY_20161216_20170329_260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210616_20210923_1390.png", "target_image": "/workspace/data/charts/full/SPY_20210616_20210923_1390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20221202_20230315_1760.png", "target_image": "/workspace/data/charts/full/SPY_20221202_20230315_1760.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180806_20181112_670.png", "target_image": "/workspace/data/charts/full/MSFT_20180806_20181112_670.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20211016_20211224_2140.png", "target_image": "/workspace/data/charts/full/BTC-USD_20211016_20211224_2140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210222_20210601_1310.png", "target_image": "/workspace/data/charts/full/SPY_20210222_20210601_1310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20231019_20240130_1980.png", "target_image": "/workspace/data/charts/full/MSFT_20231019_20240130_1980.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170626_20171003_390.png", "target_image": "/workspace/data/charts/full/AAPL_20170626_20171003_390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220613_20220921_1640.png", "target_image": "/workspace/data/charts/full/SPY_20220613_20220921_1640.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210122_20210503_1290.png", "target_image": "/workspace/data/charts/full/MSFT_20210122_20210503_1290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180316_20180524_830.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180316_20180524_830.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220822_20221030_2450.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220822_20221030_2450.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250428_20250706_3430.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250428_20250706_3430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190722_20191028_910.png", "target_image": "/workspace/data/charts/full/SPY_20190722_20191028_910.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180813_20181021_980.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180813_20181021_980.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210630_20211007_1400.png", "target_image": "/workspace/data/charts/full/MSFT_20210630_20211007_1400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210420_20210728_1350.png", "target_image": "/workspace/data/charts/full/SPY_20210420_20210728_1350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180714_20180921_950.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180714_20180921_950.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210602_20210909_1380.png", "target_image": "/workspace/data/charts/full/MSFT_20210602_20210909_1380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240524_20240904_2130.png", "target_image": "/workspace/data/charts/full/SPY_20240524_20240904_2130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160404_20160712_80.png", "target_image": "/workspace/data/charts/full/MSFT_20160404_20160712_80.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20241129_20250313_2260.png", "target_image": "/workspace/data/charts/full/SPY_20241129_20250313_2260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200520_20200827_1120.png", "target_image": "/workspace/data/charts/full/AAPL_20200520_20200827_1120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220104_20220413_1530.png", "target_image": "/workspace/data/charts/full/SPY_20220104_20220413_1530.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20191226_20200406_1020.png", "target_image": "/workspace/data/charts/full/SPY_20191226_20200406_1020.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20161022_20161230_320.png", "target_image": "/workspace/data/charts/full/BTC-USD_20161022_20161230_320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20201109_20210219_1240.png", "target_image": "/workspace/data/charts/full/SPY_20201109_20210219_1240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170927_20171205_660.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170927_20171205_660.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160628_20161005_140.png", "target_image": "/workspace/data/charts/full/MSFT_20160628_20161005_140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220414_20220726_1600.png", "target_image": "/workspace/data/charts/full/MSFT_20220414_20220726_1600.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240610_20240918_2140.png", "target_image": "/workspace/data/charts/full/SPY_20240610_20240918_2140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160404_20160712_80.png", "target_image": "/workspace/data/charts/full/AAPL_20160404_20160712_80.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240412_20240723_2100.png", "target_image": "/workspace/data/charts/full/MSFT_20240412_20240723_2100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190607_20190916_880.png", "target_image": "/workspace/data/charts/full/SPY_20190607_20190916_880.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230228_20230508_2640.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230228_20230508_2640.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20221117_20230301_1750.png", "target_image": "/workspace/data/charts/full/AAPL_20221117_20230301_1750.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250130_20250509_2300.png", "target_image": "/workspace/data/charts/full/AAPL_20250130_20250509_2300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230726_20231101_1920.png", "target_image": "/workspace/data/charts/full/MSFT_20230726_20231101_1920.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160516_20160823_110.png", "target_image": "/workspace/data/charts/full/SPY_20160516_20160823_110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200604_20200911_1130.png", "target_image": "/workspace/data/charts/full/MSFT_20200604_20200911_1130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180709_20181015_650.png", "target_image": "/workspace/data/charts/full/SPY_20180709_20181015_650.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160219_20160527_50.png", "target_image": "/workspace/data/charts/full/AAPL_20160219_20160527_50.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20191126_20200309_1000.png", "target_image": "/workspace/data/charts/full/SPY_20191126_20200309_1000.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190621_20190930_890.png", "target_image": "/workspace/data/charts/full/AAPL_20190621_20190930_890.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20201220_20210227_1840.png", "target_image": "/workspace/data/charts/full/BTC-USD_20201220_20210227_1840.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240821_20241029_3180.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240821_20241029_3180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20221103_20230214_1740.png", "target_image": "/workspace/data/charts/full/AAPL_20221103_20230214_1740.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230907_20231214_1950.png", "target_image": "/workspace/data/charts/full/SPY_20230907_20231214_1950.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20191211_20200323_1010.png", "target_image": "/workspace/data/charts/full/AAPL_20191211_20200323_1010.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210208_20210418_1890.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210208_20210418_1890.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20231019_20240130_1980.png", "target_image": "/workspace/data/charts/full/AAPL_20231019_20240130_1980.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240905_20241212_2200.png", "target_image": "/workspace/data/charts/full/SPY_20240905_20241212_2200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250807_20251113_2430.png", "target_image": "/workspace/data/charts/full/AAPL_20250807_20251113_2430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20211105_20220215_1490.png", "target_image": "/workspace/data/charts/full/MSFT_20211105_20220215_1490.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20211220_20220330_1520.png", "target_image": "/workspace/data/charts/full/AAPL_20211220_20220330_1520.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220216_20220526_1560.png", "target_image": "/workspace/data/charts/full/MSFT_20220216_20220526_1560.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230103_20230413_1780.png", "target_image": "/workspace/data/charts/full/SPY_20230103_20230413_1780.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190313_20190620_820.png", "target_image": "/workspace/data/charts/full/AAPL_20190313_20190620_820.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180224_20180504_810.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180224_20180504_810.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160205_20160414_60.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160205_20160414_60.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20241017_20250129_2230.png", "target_image": "/workspace/data/charts/full/SPY_20241017_20250129_2230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210826_20211203_1440.png", "target_image": "/workspace/data/charts/full/SPY_20210826_20211203_1440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170612_20170919_380.png", "target_image": "/workspace/data/charts/full/MSFT_20170612_20170919_380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160326_20160603_110.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160326_20160603_110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210129_20210408_1880.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210129_20210408_1880.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210630_20211007_1400.png", "target_image": "/workspace/data/charts/full/SPY_20210630_20211007_1400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20191029_20200207_980.png", "target_image": "/workspace/data/charts/full/SPY_20191029_20200207_980.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210406_20210714_1340.png", "target_image": "/workspace/data/charts/full/AAPL_20210406_20210714_1340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250625_20251002_2400.png", "target_image": "/workspace/data/charts/full/AAPL_20250625_20251002_2400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170729_20171006_600.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170729_20171006_600.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190722_20191028_910.png", "target_image": "/workspace/data/charts/full/MSFT_20190722_20191028_910.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20161020_20170131_220.png", "target_image": "/workspace/data/charts/full/AAPL_20161020_20170131_220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220414_20220622_2320.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220414_20220622_2320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240102_20240411_2030.png", "target_image": "/workspace/data/charts/full/AAPL_20240102_20240411_2030.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20181201_20190208_1090.png", "target_image": "/workspace/data/charts/full/BTC-USD_20181201_20190208_1090.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20201012_20210121_1220.png", "target_image": "/workspace/data/charts/full/SPY_20201012_20210121_1220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190805_20191111_920.png", "target_image": "/workspace/data/charts/full/MSFT_20190805_20191111_920.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200110_20200421_1030.png", "target_image": "/workspace/data/charts/full/MSFT_20200110_20200421_1030.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240102_20240411_2030.png", "target_image": "/workspace/data/charts/full/MSFT_20240102_20240411_2030.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220628_20221005_1650.png", "target_image": "/workspace/data/charts/full/SPY_20220628_20221005_1650.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20201208_20210319_1260.png", "target_image": "/workspace/data/charts/full/AAPL_20201208_20210319_1260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190607_20190916_880.png", "target_image": "/workspace/data/charts/full/MSFT_20190607_20190916_880.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250527_20250904_2380.png", "target_image": "/workspace/data/charts/full/SPY_20250527_20250904_2380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170906_20171213_440.png", "target_image": "/workspace/data/charts/full/SPY_20170906_20171213_440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220527_20220907_1630.png", "target_image": "/workspace/data/charts/full/AAPL_20220527_20220907_1630.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190729_20191006_1330.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190729_20191006_1330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250314_20250624_2330.png", "target_image": "/workspace/data/charts/full/SPY_20250314_20250624_2330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230526_20230906_1880.png", "target_image": "/workspace/data/charts/full/MSFT_20230526_20230906_1880.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200717_20201023_1160.png", "target_image": "/workspace/data/charts/full/MSFT_20200717_20201023_1160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250309_20250517_3380.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250309_20250517_3380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180228_20180607_560.png", "target_image": "/workspace/data/charts/full/MSFT_20180228_20180607_560.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240104_20240313_2950.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240104_20240313_2950.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230612_20230920_1890.png", "target_image": "/workspace/data/charts/full/AAPL_20230612_20230920_1890.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180608_20180917_630.png", "target_image": "/workspace/data/charts/full/SPY_20180608_20180917_630.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250108_20250318_3320.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250108_20250318_3320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20151221_20160401_10.png", "target_image": "/workspace/data/charts/full/AAPL_20151221_20160401_10.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210916_20211124_2110.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210916_20211124_2110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180426_20180803_600.png", "target_image": "/workspace/data/charts/full/SPY_20180426_20180803_600.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230627_20231004_1900.png", "target_image": "/workspace/data/charts/full/AAPL_20230627_20231004_1900.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190805_20191111_920.png", "target_image": "/workspace/data/charts/full/AAPL_20190805_20191111_920.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240510_20240820_2120.png", "target_image": "/workspace/data/charts/full/MSFT_20240510_20240820_2120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20221120_20230128_2540.png", "target_image": "/workspace/data/charts/full/BTC-USD_20221120_20230128_2540.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190609_20190817_1280.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190609_20190817_1280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160306_20160514_90.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160306_20160514_90.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230627_20231004_1900.png", "target_image": "/workspace/data/charts/full/SPY_20230627_20231004_1900.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250408_20250616_3410.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250408_20250616_3410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240602_20240810_3100.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240602_20240810_3100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200324_20200701_1080.png", "target_image": "/workspace/data/charts/full/AAPL_20200324_20200701_1080.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200422_20200730_1100.png", "target_image": "/workspace/data/charts/full/MSFT_20200422_20200730_1100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20221001_20221209_2490.png", "target_image": "/workspace/data/charts/full/BTC-USD_20221001_20221209_2490.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230409_20230617_2680.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230409_20230617_2680.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20231026_20240103_2880.png", "target_image": "/workspace/data/charts/full/BTC-USD_20231026_20240103_2880.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200914_20201221_1200.png", "target_image": "/workspace/data/charts/full/SPY_20200914_20201221_1200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220315_20220523_2290.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220315_20220523_2290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170219_20170429_440.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170219_20170429_440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20211022_20220201_1480.png", "target_image": "/workspace/data/charts/full/SPY_20211022_20220201_1480.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190828_20191105_1360.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190828_20191105_1360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20221117_20230301_1750.png", "target_image": "/workspace/data/charts/full/SPY_20221117_20230301_1750.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240102_20240411_2030.png", "target_image": "/workspace/data/charts/full/SPY_20240102_20240411_2030.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180922_20181130_1020.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180922_20181130_1020.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20161117_20170301_240.png", "target_image": "/workspace/data/charts/full/MSFT_20161117_20170301_240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190410_20190719_840.png", "target_image": "/workspace/data/charts/full/SPY_20190410_20190719_840.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170316_20170623_320.png", "target_image": "/workspace/data/charts/full/AAPL_20170316_20170623_320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20221011_20221219_2500.png", "target_image": "/workspace/data/charts/full/BTC-USD_20221011_20221219_2500.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190805_20191111_920.png", "target_image": "/workspace/data/charts/full/SPY_20190805_20191111_920.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230118_20230427_1790.png", "target_image": "/workspace/data/charts/full/MSFT_20230118_20230427_1790.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230712_20231018_1910.png", "target_image": "/workspace/data/charts/full/MSFT_20230712_20231018_1910.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20161002_20161210_300.png", "target_image": "/workspace/data/charts/full/BTC-USD_20161002_20161210_300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210218_20210428_1900.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210218_20210428_1900.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240426_20240806_2110.png", "target_image": "/workspace/data/charts/full/AAPL_20240426_20240806_2110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20161202_20170315_250.png", "target_image": "/workspace/data/charts/full/MSFT_20161202_20170315_250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20161221_20170228_380.png", "target_image": "/workspace/data/charts/full/BTC-USD_20161221_20170228_380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20211119_20220302_1500.png", "target_image": "/workspace/data/charts/full/AAPL_20211119_20220302_1500.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220727_20221102_1670.png", "target_image": "/workspace/data/charts/full/SPY_20220727_20221102_1670.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240413_20240621_3050.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240413_20240621_3050.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220727_20221102_1670.png", "target_image": "/workspace/data/charts/full/AAPL_20220727_20221102_1670.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220114_20220324_2230.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220114_20220324_2230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190219_20190429_1170.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190219_20190429_1170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160219_20160527_50.png", "target_image": "/workspace/data/charts/full/MSFT_20160219_20160527_50.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220810_20221116_1680.png", "target_image": "/workspace/data/charts/full/MSFT_20220810_20221116_1680.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160106_20160415_20.png", "target_image": "/workspace/data/charts/full/AAPL_20160106_20160415_20.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220922_20221230_1710.png", "target_image": "/workspace/data/charts/full/SPY_20220922_20221230_1710.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20221216_20230329_1770.png", "target_image": "/workspace/data/charts/full/MSFT_20221216_20230329_1770.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170302_20170609_310.png", "target_image": "/workspace/data/charts/full/MSFT_20170302_20170609_310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210924_20220103_1460.png", "target_image": "/workspace/data/charts/full/SPY_20210924_20220103_1460.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250518_20250726_3450.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250518_20250726_3450.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190212_20190522_800.png", "target_image": "/workspace/data/charts/full/SPY_20190212_20190522_800.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160106_20160415_20.png", "target_image": "/workspace/data/charts/full/SPY_20160106_20160415_20.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220124_20220403_2240.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220124_20220403_2240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210708_20210915_2040.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210708_20210915_2040.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20161006_20170117_210.png", "target_image": "/workspace/data/charts/full/SPY_20161006_20170117_210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20241209_20250216_3290.png", "target_image": "/workspace/data/charts/full/BTC-USD_20241209_20250216_3290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230201_20230511_1800.png", "target_image": "/workspace/data/charts/full/MSFT_20230201_20230511_1800.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20191211_20200323_1010.png", "target_image": "/workspace/data/charts/full/MSFT_20191211_20200323_1010.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200717_20201023_1160.png", "target_image": "/workspace/data/charts/full/AAPL_20200717_20201023_1160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250411_20250723_2350.png", "target_image": "/workspace/data/charts/full/SPY_20250411_20250723_2350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220812_20221020_2440.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220812_20221020_2440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190327_20190705_830.png", "target_image": "/workspace/data/charts/full/SPY_20190327_20190705_830.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230921_20231229_1960.png", "target_image": "/workspace/data/charts/full/SPY_20230921_20231229_1960.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210504_20210811_1360.png", "target_image": "/workspace/data/charts/full/MSFT_20210504_20210811_1360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210308_20210615_1320.png", "target_image": "/workspace/data/charts/full/MSFT_20210308_20210615_1320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20151217_20160224_10.png", "target_image": "/workspace/data/charts/full/BTC-USD_20151217_20160224_10.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230823_20231130_1940.png", "target_image": "/workspace/data/charts/full/MSFT_20230823_20231130_1940.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230628_20230905_2760.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230628_20230905_2760.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170215_20170525_300.png", "target_image": "/workspace/data/charts/full/SPY_20170215_20170525_300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190917_20191125_1380.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190917_20191125_1380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20191126_20200309_1000.png", "target_image": "/workspace/data/charts/full/MSFT_20191126_20200309_1000.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20171115_20180227_490.png", "target_image": "/workspace/data/charts/full/MSFT_20171115_20180227_490.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20201026_20210204_1230.png", "target_image": "/workspace/data/charts/full/SPY_20201026_20210204_1230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20161117_20170301_240.png", "target_image": "/workspace/data/charts/full/AAPL_20161117_20170301_240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230809_20231115_1930.png", "target_image": "/workspace/data/charts/full/AAPL_20230809_20231115_1930.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20231201_20240313_2010.png", "target_image": "/workspace/data/charts/full/MSFT_20231201_20240313_2010.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250115_20250425_2290.png", "target_image": "/workspace/data/charts/full/SPY_20250115_20250425_2290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200324_20200701_1080.png", "target_image": "/workspace/data/charts/full/SPY_20200324_20200701_1080.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20171126_20180203_720.png", "target_image": "/workspace/data/charts/full/BTC-USD_20171126_20180203_720.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160628_20161005_140.png", "target_image": "/workspace/data/charts/full/AAPL_20160628_20161005_140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180918_20181227_700.png", "target_image": "/workspace/data/charts/full/MSFT_20180918_20181227_700.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190523_20190830_870.png", "target_image": "/workspace/data/charts/full/SPY_20190523_20190830_870.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230428_20230808_1860.png", "target_image": "/workspace/data/charts/full/MSFT_20230428_20230808_1860.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180116_20180425_530.png", "target_image": "/workspace/data/charts/full/AAPL_20180116_20180425_530.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180622_20181001_640.png", "target_image": "/workspace/data/charts/full/AAPL_20180622_20181001_640.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200928_20210106_1210.png", "target_image": "/workspace/data/charts/full/AAPL_20200928_20210106_1210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200225_20200603_1060.png", "target_image": "/workspace/data/charts/full/SPY_20200225_20200603_1060.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240905_20241212_2200.png", "target_image": "/workspace/data/charts/full/MSFT_20240905_20241212_2200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20241031_20250212_2240.png", "target_image": "/workspace/data/charts/full/MSFT_20241031_20250212_2240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160316_20160524_100.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160316_20160524_100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170428_20170807_350.png", "target_image": "/workspace/data/charts/full/MSFT_20170428_20170807_350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200618_20200925_1140.png", "target_image": "/workspace/data/charts/full/AAPL_20200618_20200925_1140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20181002_20190111_710.png", "target_image": "/workspace/data/charts/full/AAPL_20181002_20190111_710.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20231201_20240313_2010.png", "target_image": "/workspace/data/charts/full/AAPL_20231201_20240313_2010.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180723_20181029_660.png", "target_image": "/workspace/data/charts/full/SPY_20180723_20181029_660.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210826_20211203_1440.png", "target_image": "/workspace/data/charts/full/MSFT_20210826_20211203_1440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20231105_20240113_2890.png", "target_image": "/workspace/data/charts/full/BTC-USD_20231105_20240113_2890.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180510_20180817_610.png", "target_image": "/workspace/data/charts/full/SPY_20180510_20180817_610.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240625_20241002_2150.png", "target_image": "/workspace/data/charts/full/AAPL_20240625_20241002_2150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170725_20171031_410.png", "target_image": "/workspace/data/charts/full/AAPL_20170725_20171031_410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160405_20160613_120.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160405_20160613_120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20181228_20190409_770.png", "target_image": "/workspace/data/charts/full/MSFT_20181228_20190409_770.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210222_20210601_1310.png", "target_image": "/workspace/data/charts/full/AAPL_20210222_20210601_1310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240524_20240904_2130.png", "target_image": "/workspace/data/charts/full/AAPL_20240524_20240904_2130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180130_20180509_540.png", "target_image": "/workspace/data/charts/full/SPY_20180130_20180509_540.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190130_20190409_1150.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190130_20190409_1150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240213_20240422_2990.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240213_20240422_2990.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190129_20190508_790.png", "target_image": "/workspace/data/charts/full/AAPL_20190129_20190508_790.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20221006_20230117_1720.png", "target_image": "/workspace/data/charts/full/AAPL_20221006_20230117_1720.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20201012_20210121_1220.png", "target_image": "/workspace/data/charts/full/AAPL_20201012_20210121_1220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20181030_20190211_730.png", "target_image": "/workspace/data/charts/full/SPY_20181030_20190211_730.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230529_20230806_2730.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230529_20230806_2730.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210602_20210909_1380.png", "target_image": "/workspace/data/charts/full/AAPL_20210602_20210909_1380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210728_20211005_2060.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210728_20211005_2060.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170719_20170926_590.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170719_20170926_590.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160704_20160911_210.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160704_20160911_210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160724_20161001_230.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160724_20161001_230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20221020_20230131_1730.png", "target_image": "/workspace/data/charts/full/MSFT_20221020_20230131_1730.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220404_20220612_2310.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220404_20220612_2310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20181113_20190226_740.png", "target_image": "/workspace/data/charts/full/AAPL_20181113_20190226_740.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170420_20170628_500.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170420_20170628_500.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200524_20200801_1630.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200524_20200801_1630.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190227_20190606_810.png", "target_image": "/workspace/data/charts/full/MSFT_20190227_20190606_810.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20231005_20240116_1970.png", "target_image": "/workspace/data/charts/full/AAPL_20231005_20240116_1970.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210205_20210517_1300.png", "target_image": "/workspace/data/charts/full/AAPL_20210205_20210517_1300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220802_20221010_2430.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220802_20221010_2430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250228_20250609_2320.png", "target_image": "/workspace/data/charts/full/SPY_20250228_20250609_2320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180608_20180917_630.png", "target_image": "/workspace/data/charts/full/MSFT_20180608_20180917_630.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20241031_20250212_2240.png", "target_image": "/workspace/data/charts/full/SPY_20241031_20250212_2240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20161103_20170214_230.png", "target_image": "/workspace/data/charts/full/AAPL_20161103_20170214_230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240724_20241030_2170.png", "target_image": "/workspace/data/charts/full/MSFT_20240724_20241030_2170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220908_20221215_1700.png", "target_image": "/workspace/data/charts/full/AAPL_20220908_20221215_1700.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210729_20211104_1420.png", "target_image": "/workspace/data/charts/full/AAPL_20210729_20211104_1420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20181030_20190211_730.png", "target_image": "/workspace/data/charts/full/AAPL_20181030_20190211_730.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20191206_20200213_1460.png", "target_image": "/workspace/data/charts/full/BTC-USD_20191206_20200213_1460.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20191126_20200309_1000.png", "target_image": "/workspace/data/charts/full/AAPL_20191126_20200309_1000.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20171130_20180313_500.png", "target_image": "/workspace/data/charts/full/MSFT_20171130_20180313_500.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180326_20180603_840.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180326_20180603_840.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240117_20240425_2040.png", "target_image": "/workspace/data/charts/full/SPY_20240117_20240425_2040.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160215_20160424_70.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160215_20160424_70.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180622_20181001_640.png", "target_image": "/workspace/data/charts/full/MSFT_20180622_20181001_640.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180204_20180414_790.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180204_20180414_790.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20221216_20230329_1770.png", "target_image": "/workspace/data/charts/full/SPY_20221216_20230329_1770.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220414_20220726_1600.png", "target_image": "/workspace/data/charts/full/AAPL_20220414_20220726_1600.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200814_20201120_1180.png", "target_image": "/workspace/data/charts/full/SPY_20200814_20201120_1180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180116_20180425_530.png", "target_image": "/workspace/data/charts/full/MSFT_20180116_20180425_530.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160813_20161021_250.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160813_20161021_250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160404_20160712_80.png", "target_image": "/workspace/data/charts/full/SPY_20160404_20160712_80.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200407_20200716_1090.png", "target_image": "/workspace/data/charts/full/MSFT_20200407_20200716_1090.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190212_20190522_800.png", "target_image": "/workspace/data/charts/full/MSFT_20190212_20190522_800.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20171004_20180112_460.png", "target_image": "/workspace/data/charts/full/AAPL_20171004_20180112_460.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240524_20240904_2130.png", "target_image": "/workspace/data/charts/full/MSFT_20240524_20240904_2130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230809_20231115_1930.png", "target_image": "/workspace/data/charts/full/MSFT_20230809_20231115_1930.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220331_20220712_1590.png", "target_image": "/workspace/data/charts/full/AAPL_20220331_20220712_1590.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210322_20210629_1330.png", "target_image": "/workspace/data/charts/full/AAPL_20210322_20210629_1330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190722_20191028_910.png", "target_image": "/workspace/data/charts/full/AAPL_20190722_20191028_910.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240328_20240709_2090.png", "target_image": "/workspace/data/charts/full/AAPL_20240328_20240709_2090.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240203_20240412_2980.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240203_20240412_2980.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220216_20220526_1560.png", "target_image": "/workspace/data/charts/full/SPY_20220216_20220526_1560.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160614_20160822_190.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160614_20160822_190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220424_20220702_2330.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220424_20220702_2330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250610_20250918_2390.png", "target_image": "/workspace/data/charts/full/AAPL_20250610_20250918_2390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20171214_20180327_510.png", "target_image": "/workspace/data/charts/full/SPY_20171214_20180327_510.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190523_20190830_870.png", "target_image": "/workspace/data/charts/full/MSFT_20190523_20190830_870.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190420_20190628_1230.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190420_20190628_1230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170818_20171026_620.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170818_20171026_620.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230627_20231004_1900.png", "target_image": "/workspace/data/charts/full/MSFT_20230627_20231004_1900.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20171214_20180327_510.png", "target_image": "/workspace/data/charts/full/MSFT_20171214_20180327_510.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20221103_20230214_1740.png", "target_image": "/workspace/data/charts/full/MSFT_20221103_20230214_1740.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20211026_20220103_2150.png", "target_image": "/workspace/data/charts/full/BTC-USD_20211026_20220103_2150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240423_20240701_3060.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240423_20240701_3060.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20231115_20240123_2900.png", "target_image": "/workspace/data/charts/full/BTC-USD_20231115_20240123_2900.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20161103_20170214_230.png", "target_image": "/workspace/data/charts/full/MSFT_20161103_20170214_230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190327_20190705_830.png", "target_image": "/workspace/data/charts/full/AAPL_20190327_20190705_830.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20241230_20250410_2280.png", "target_image": "/workspace/data/charts/full/AAPL_20241230_20250410_2280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210406_20210714_1340.png", "target_image": "/workspace/data/charts/full/MSFT_20210406_20210714_1340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180425_20180703_870.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180425_20180703_870.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20221220_20230227_2570.png", "target_image": "/workspace/data/charts/full/BTC-USD_20221220_20230227_2570.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200422_20200730_1100.png", "target_image": "/workspace/data/charts/full/AAPL_20200422_20200730_1100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20191226_20200304_1480.png", "target_image": "/workspace/data/charts/full/BTC-USD_20191226_20200304_1480.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250610_20250918_2390.png", "target_image": "/workspace/data/charts/full/SPY_20250610_20250918_2390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200802_20201010_1700.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200802_20201010_1700.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210122_20210503_1290.png", "target_image": "/workspace/data/charts/full/AAPL_20210122_20210503_1290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200822_20201030_1720.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200822_20201030_1720.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160604_20160812_180.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160604_20160812_180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220628_20221005_1650.png", "target_image": "/workspace/data/charts/full/AAPL_20220628_20221005_1650.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180524_20180831_620.png", "target_image": "/workspace/data/charts/full/AAPL_20180524_20180831_620.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210504_20210811_1360.png", "target_image": "/workspace/data/charts/full/SPY_20210504_20210811_1360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220303_20220610_1570.png", "target_image": "/workspace/data/charts/full/SPY_20220303_20220610_1570.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220513_20220823_1620.png", "target_image": "/workspace/data/charts/full/AAPL_20220513_20220823_1620.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240724_20241030_2170.png", "target_image": "/workspace/data/charts/full/SPY_20240724_20241030_2170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200828_20201207_1190.png", "target_image": "/workspace/data/charts/full/MSFT_20200828_20201207_1190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230823_20231130_1940.png", "target_image": "/workspace/data/charts/full/AAPL_20230823_20231130_1940.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20221202_20230315_1760.png", "target_image": "/workspace/data/charts/full/AAPL_20221202_20230315_1760.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160304_20160613_60.png", "target_image": "/workspace/data/charts/full/SPY_20160304_20160613_60.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20221031_20230108_2520.png", "target_image": "/workspace/data/charts/full/BTC-USD_20221031_20230108_2520.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160121_20160429_30.png", "target_image": "/workspace/data/charts/full/MSFT_20160121_20160429_30.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20221230_20230309_2580.png", "target_image": "/workspace/data/charts/full/BTC-USD_20221230_20230309_2580.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20181213_20190326_760.png", "target_image": "/workspace/data/charts/full/MSFT_20181213_20190326_760.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210107_20210419_1280.png", "target_image": "/workspace/data/charts/full/AAPL_20210107_20210419_1280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20241213_20250327_2270.png", "target_image": "/workspace/data/charts/full/MSFT_20241213_20250327_2270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250625_20251002_2400.png", "target_image": "/workspace/data/charts/full/MSFT_20250625_20251002_2400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20211206_20220316_1510.png", "target_image": "/workspace/data/charts/full/SPY_20211206_20220316_1510.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20191106_20200114_1430.png", "target_image": "/workspace/data/charts/full/BTC-USD_20191106_20200114_1430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160106_20160315_30.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160106_20160315_30.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230201_20230511_1800.png", "target_image": "/workspace/data/charts/full/AAPL_20230201_20230511_1800.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190509_20190816_860.png", "target_image": "/workspace/data/charts/full/MSFT_20190509_20190816_860.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240625_20241002_2150.png", "target_image": "/workspace/data/charts/full/MSFT_20240625_20241002_2150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20211008_20220118_1470.png", "target_image": "/workspace/data/charts/full/MSFT_20211008_20220118_1470.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200604_20200911_1130.png", "target_image": "/workspace/data/charts/full/AAPL_20200604_20200911_1130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240807_20241113_2180.png", "target_image": "/workspace/data/charts/full/AAPL_20240807_20241113_2180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20201011_20201219_1770.png", "target_image": "/workspace/data/charts/full/BTC-USD_20201011_20201219_1770.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200731_20201106_1170.png", "target_image": "/workspace/data/charts/full/AAPL_20200731_20201106_1170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160714_20160921_220.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160714_20160921_220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250319_20250527_3390.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250319_20250527_3390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210109_20210319_1860.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210109_20210319_1860.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210729_20211104_1420.png", "target_image": "/workspace/data/charts/full/SPY_20210729_20211104_1420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170512_20170821_360.png", "target_image": "/workspace/data/charts/full/SPY_20170512_20170821_360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20181002_20181210_1030.png", "target_image": "/workspace/data/charts/full/BTC-USD_20181002_20181210_1030.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170331_20170608_480.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170331_20170608_480.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220613_20220921_1640.png", "target_image": "/workspace/data/charts/full/AAPL_20220613_20220921_1640.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170103_20170412_270.png", "target_image": "/workspace/data/charts/full/AAPL_20170103_20170412_270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230129_20230408_2610.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230129_20230408_2610.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20151227_20160305_20.png", "target_image": "/workspace/data/charts/full/BTC-USD_20151227_20160305_20.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200814_20201120_1180.png", "target_image": "/workspace/data/charts/full/MSFT_20200814_20201120_1180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20231125_20240202_2910.png", "target_image": "/workspace/data/charts/full/BTC-USD_20231125_20240202_2910.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250418_20250626_3420.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250418_20250626_3420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20211220_20220330_1520.png", "target_image": "/workspace/data/charts/full/SPY_20211220_20220330_1520.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20171101_20180212_480.png", "target_image": "/workspace/data/charts/full/SPY_20171101_20180212_480.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20181228_20190409_770.png", "target_image": "/workspace/data/charts/full/SPY_20181228_20190409_770.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190708_20191014_900.png", "target_image": "/workspace/data/charts/full/AAPL_20190708_20191014_900.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180105_20180315_760.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180105_20180315_760.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250508_20250716_3440.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250508_20250716_3440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20231006_20231214_2860.png", "target_image": "/workspace/data/charts/full/BTC-USD_20231006_20231214_2860.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220429_20220809_1610.png", "target_image": "/workspace/data/charts/full/SPY_20220429_20220809_1610.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20151207_20160214_0.png", "target_image": "/workspace/data/charts/full/BTC-USD_20151207_20160214_0.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210518_20210825_1370.png", "target_image": "/workspace/data/charts/full/AAPL_20210518_20210825_1370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250816_20251024_3540.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250816_20251024_3540.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250428_20250806_2360.png", "target_image": "/workspace/data/charts/full/MSFT_20250428_20250806_2360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230429_20230707_2700.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230429_20230707_2700.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220810_20221116_1680.png", "target_image": "/workspace/data/charts/full/AAPL_20220810_20221116_1680.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230726_20231101_1920.png", "target_image": "/workspace/data/charts/full/AAPL_20230726_20231101_1920.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220513_20220823_1620.png", "target_image": "/workspace/data/charts/full/MSFT_20220513_20220823_1620.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180709_20181015_650.png", "target_image": "/workspace/data/charts/full/AAPL_20180709_20181015_650.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160922_20161230_200.png", "target_image": "/workspace/data/charts/full/MSFT_20160922_20161230_200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180415_20180623_860.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180415_20180623_860.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230316_20230626_1830.png", "target_image": "/workspace/data/charts/full/MSFT_20230316_20230626_1830.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230218_20230428_2630.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230218_20230428_2630.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180614_20180822_920.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180614_20180822_920.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220203_20220413_2250.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220203_20220413_2250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20151207_20160317_0.png", "target_image": "/workspace/data/charts/full/AAPL_20151207_20160317_0.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200702_20201009_1150.png", "target_image": "/workspace/data/charts/full/MSFT_20200702_20201009_1150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180130_20180509_540.png", "target_image": "/workspace/data/charts/full/MSFT_20180130_20180509_540.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20241017_20250129_2230.png", "target_image": "/workspace/data/charts/full/AAPL_20241017_20250129_2230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20161211_20170218_370.png", "target_image": "/workspace/data/charts/full/BTC-USD_20161211_20170218_370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20241010_20241218_3230.png", "target_image": "/workspace/data/charts/full/BTC-USD_20241010_20241218_3230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230807_20231015_2800.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230807_20231015_2800.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230817_20231025_2810.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230817_20231025_2810.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210608_20210816_2010.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210608_20210816_2010.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230916_20231124_2840.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230916_20231124_2840.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250130_20250509_2300.png", "target_image": "/workspace/data/charts/full/SPY_20250130_20250509_2300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200911_20201119_1740.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200911_20201119_1740.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190410_20190719_840.png", "target_image": "/workspace/data/charts/full/AAPL_20190410_20190719_840.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220603_20220811_2370.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220603_20220811_2370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190114_20190424_780.png", "target_image": "/workspace/data/charts/full/SPY_20190114_20190424_780.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230921_20231229_1960.png", "target_image": "/workspace/data/charts/full/AAPL_20230921_20231229_1960.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160922_20161230_200.png", "target_image": "/workspace/data/charts/full/SPY_20160922_20161230_200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200225_20200603_1060.png", "target_image": "/workspace/data/charts/full/MSFT_20200225_20200603_1060.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240328_20240709_2090.png", "target_image": "/workspace/data/charts/full/MSFT_20240328_20240709_2090.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160810_20161116_170.png", "target_image": "/workspace/data/charts/full/AAPL_20160810_20161116_170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210320_20210528_1930.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210320_20210528_1930.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20161216_20170329_260.png", "target_image": "/workspace/data/charts/full/AAPL_20161216_20170329_260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20171115_20180227_490.png", "target_image": "/workspace/data/charts/full/AAPL_20171115_20180227_490.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20221006_20230117_1720.png", "target_image": "/workspace/data/charts/full/MSFT_20221006_20230117_1720.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160126_20160404_50.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160126_20160404_50.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180510_20180817_610.png", "target_image": "/workspace/data/charts/full/AAPL_20180510_20180817_610.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220213_20220423_2260.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220213_20220423_2260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210906_20211114_2100.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210906_20211114_2100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170808_20171016_610.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170808_20171016_610.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210420_20210728_1350.png", "target_image": "/workspace/data/charts/full/MSFT_20210420_20210728_1350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200506_20200813_1110.png", "target_image": "/workspace/data/charts/full/SPY_20200506_20200813_1110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240523_20240731_3090.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240523_20240731_3090.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160502_20160809_100.png", "target_image": "/workspace/data/charts/full/SPY_20160502_20160809_100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180510_20180817_610.png", "target_image": "/workspace/data/charts/full/MSFT_20180510_20180817_610.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170209_20170419_430.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170209_20170419_430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230316_20230626_1830.png", "target_image": "/workspace/data/charts/full/AAPL_20230316_20230626_1830.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230726_20231101_1920.png", "target_image": "/workspace/data/charts/full/SPY_20230726_20231101_1920.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230519_20230727_2720.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230519_20230727_2720.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180704_20180911_940.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180704_20180911_940.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230921_20231229_1960.png", "target_image": "/workspace/data/charts/full/MSFT_20230921_20231229_1960.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220202_20220512_1550.png", "target_image": "/workspace/data/charts/full/SPY_20220202_20220512_1550.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180426_20180803_600.png", "target_image": "/workspace/data/charts/full/MSFT_20180426_20180803_600.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170512_20170821_360.png", "target_image": "/workspace/data/charts/full/MSFT_20170512_20170821_360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160516_20160823_110.png", "target_image": "/workspace/data/charts/full/AAPL_20160516_20160823_110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210910_20211217_1450.png", "target_image": "/workspace/data/charts/full/SPY_20210910_20211217_1450.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240426_20240806_2110.png", "target_image": "/workspace/data/charts/full/SPY_20240426_20240806_2110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190709_20190916_1310.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190709_20190916_1310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210310_20210518_1920.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210310_20210518_1920.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230926_20231204_2850.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230926_20231204_2850.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210406_20210714_1340.png", "target_image": "/workspace/data/charts/full/SPY_20210406_20210714_1340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190129_20190508_790.png", "target_image": "/workspace/data/charts/full/MSFT_20190129_20190508_790.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230414_20230725_1850.png", "target_image": "/workspace/data/charts/full/AAPL_20230414_20230725_1850.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220429_20220809_1610.png", "target_image": "/workspace/data/charts/full/AAPL_20220429_20220809_1610.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170808_20171114_420.png", "target_image": "/workspace/data/charts/full/AAPL_20170808_20171114_420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20181228_20190409_770.png", "target_image": "/workspace/data/charts/full/AAPL_20181228_20190409_770.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200623_20200831_1660.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200623_20200831_1660.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250512_20250820_2370.png", "target_image": "/workspace/data/charts/full/SPY_20250512_20250820_2370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250213_20250523_2310.png", "target_image": "/workspace/data/charts/full/AAPL_20250213_20250523_2310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210222_20210601_1310.png", "target_image": "/workspace/data/charts/full/MSFT_20210222_20210601_1310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20201120_20210128_1810.png", "target_image": "/workspace/data/charts/full/BTC-USD_20201120_20210128_1810.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190227_20190606_810.png", "target_image": "/workspace/data/charts/full/AAPL_20190227_20190606_810.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190903_20191210_940.png", "target_image": "/workspace/data/charts/full/AAPL_20190903_20191210_940.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200110_20200421_1030.png", "target_image": "/workspace/data/charts/full/SPY_20200110_20200421_1030.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230208_20230418_2620.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230208_20230418_2620.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190607_20190916_880.png", "target_image": "/workspace/data/charts/full/AAPL_20190607_20190916_880.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20241020_20241228_3240.png", "target_image": "/workspace/data/charts/full/BTC-USD_20241020_20241228_3240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250314_20250624_2330.png", "target_image": "/workspace/data/charts/full/AAPL_20250314_20250624_2330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20201230_20210309_1850.png", "target_image": "/workspace/data/charts/full/BTC-USD_20201230_20210309_1850.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240503_20240711_3070.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240503_20240711_3070.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180412_20180720_590.png", "target_image": "/workspace/data/charts/full/MSFT_20180412_20180720_590.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250328_20250709_2340.png", "target_image": "/workspace/data/charts/full/MSFT_20250328_20250709_2340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250328_20250709_2340.png", "target_image": "/workspace/data/charts/full/SPY_20250328_20250709_2340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200110_20200421_1030.png", "target_image": "/workspace/data/charts/full/AAPL_20200110_20200421_1030.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230512_20230822_1870.png", "target_image": "/workspace/data/charts/full/SPY_20230512_20230822_1870.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20191112_20200224_990.png", "target_image": "/workspace/data/charts/full/AAPL_20191112_20200224_990.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210518_20210825_1370.png", "target_image": "/workspace/data/charts/full/MSFT_20210518_20210825_1370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170530_20170807_540.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170530_20170807_540.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170709_20170916_580.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170709_20170916_580.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180314_20180621_570.png", "target_image": "/workspace/data/charts/full/SPY_20180314_20180621_570.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230118_20230427_1790.png", "target_image": "/workspace/data/charts/full/SPY_20230118_20230427_1790.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210322_20210629_1330.png", "target_image": "/workspace/data/charts/full/SPY_20210322_20210629_1330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180820_20181127_680.png", "target_image": "/workspace/data/charts/full/AAPL_20180820_20181127_680.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170520_20170728_530.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170520_20170728_530.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180723_20181029_660.png", "target_image": "/workspace/data/charts/full/MSFT_20180723_20181029_660.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190903_20191210_940.png", "target_image": "/workspace/data/charts/full/SPY_20190903_20191210_940.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20241213_20250327_2270.png", "target_image": "/workspace/data/charts/full/AAPL_20241213_20250327_2270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210827_20211104_2090.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210827_20211104_2090.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20171101_20180212_480.png", "target_image": "/workspace/data/charts/full/AAPL_20171101_20180212_480.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170828_20171105_630.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170828_20171105_630.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200921_20201129_1750.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200921_20201129_1750.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20181213_20190326_760.png", "target_image": "/workspace/data/charts/full/SPY_20181213_20190326_760.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200414_20200622_1590.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200414_20200622_1590.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250710_20251016_2410.png", "target_image": "/workspace/data/charts/full/SPY_20250710_20251016_2410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240114_20240323_2960.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240114_20240323_2960.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160902_20161110_270.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160902_20161110_270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160525_20160802_170.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160525_20160802_170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210504_20210811_1360.png", "target_image": "/workspace/data/charts/full/AAPL_20210504_20210811_1360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20181016_20190128_720.png", "target_image": "/workspace/data/charts/full/AAPL_20181016_20190128_720.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20211105_20220113_2160.png", "target_image": "/workspace/data/charts/full/BTC-USD_20211105_20220113_2160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210308_20210615_1320.png", "target_image": "/workspace/data/charts/full/SPY_20210308_20210615_1320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170316_20170623_320.png", "target_image": "/workspace/data/charts/full/SPY_20170316_20170623_320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240710_20241016_2160.png", "target_image": "/workspace/data/charts/full/AAPL_20240710_20241016_2160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200305_20200513_1550.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200305_20200513_1550.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190520_20190728_1260.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190520_20190728_1260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20221210_20230217_2560.png", "target_image": "/workspace/data/charts/full/BTC-USD_20221210_20230217_2560.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240510_20240820_2120.png", "target_image": "/workspace/data/charts/full/AAPL_20240510_20240820_2120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170302_20170609_310.png", "target_image": "/workspace/data/charts/full/AAPL_20170302_20170609_310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20161103_20170214_230.png", "target_image": "/workspace/data/charts/full/SPY_20161103_20170214_230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160908_20161215_190.png", "target_image": "/workspace/data/charts/full/AAPL_20160908_20161215_190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250411_20250723_2350.png", "target_image": "/workspace/data/charts/full/MSFT_20250411_20250723_2350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250115_20250425_2290.png", "target_image": "/workspace/data/charts/full/MSFT_20250115_20250425_2290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210910_20211217_1450.png", "target_image": "/workspace/data/charts/full/MSFT_20210910_20211217_1450.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220331_20220712_1590.png", "target_image": "/workspace/data/charts/full/MSFT_20220331_20220712_1590.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20191007_20191215_1400.png", "target_image": "/workspace/data/charts/full/BTC-USD_20191007_20191215_1400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250512_20250820_2370.png", "target_image": "/workspace/data/charts/full/MSFT_20250512_20250820_2370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190903_20191210_940.png", "target_image": "/workspace/data/charts/full/MSFT_20190903_20191210_940.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170118_20170427_280.png", "target_image": "/workspace/data/charts/full/MSFT_20170118_20170427_280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220305_20220513_2280.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220305_20220513_2280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20241003_20250114_2220.png", "target_image": "/workspace/data/charts/full/AAPL_20241003_20250114_2220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190927_20191205_1390.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190927_20191205_1390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20191211_20200323_1010.png", "target_image": "/workspace/data/charts/full/SPY_20191211_20200323_1010.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170330_20170710_330.png", "target_image": "/workspace/data/charts/full/AAPL_20170330_20170710_330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20211205_20220212_2190.png", "target_image": "/workspace/data/charts/full/BTC-USD_20211205_20220212_2190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250625_20251002_2400.png", "target_image": "/workspace/data/charts/full/SPY_20250625_20251002_2400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20171007_20171215_670.png", "target_image": "/workspace/data/charts/full/BTC-USD_20171007_20171215_670.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210715_20211021_1410.png", "target_image": "/workspace/data/charts/full/MSFT_20210715_20211021_1410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180328_20180706_580.png", "target_image": "/workspace/data/charts/full/AAPL_20180328_20180706_580.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200324_20200701_1080.png", "target_image": "/workspace/data/charts/full/MSFT_20200324_20200701_1080.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210715_20211021_1410.png", "target_image": "/workspace/data/charts/full/AAPL_20210715_20211021_1410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200404_20200612_1580.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200404_20200612_1580.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250228_20250609_2320.png", "target_image": "/workspace/data/charts/full/MSFT_20250228_20250609_2320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200812_20201020_1710.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200812_20201020_1710.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180412_20180720_590.png", "target_image": "/workspace/data/charts/full/SPY_20180412_20180720_590.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190110_20190320_1130.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190110_20190320_1130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230419_20230627_2690.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230419_20230627_2690.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180314_20180621_570.png", "target_image": "/workspace/data/charts/full/AAPL_20180314_20180621_570.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20240229_20240607_2070.png", "target_image": "/workspace/data/charts/full/MSFT_20240229_20240607_2070.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20241129_20250313_2260.png", "target_image": "/workspace/data/charts/full/AAPL_20241129_20250313_2260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20171130_20180313_500.png", "target_image": "/workspace/data/charts/full/AAPL_20171130_20180313_500.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20161020_20170131_220.png", "target_image": "/workspace/data/charts/full/SPY_20161020_20170131_220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190425_20190802_850.png", "target_image": "/workspace/data/charts/full/SPY_20190425_20190802_850.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250528_20250805_3460.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250528_20250805_3460.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220922_20221230_1710.png", "target_image": "/workspace/data/charts/full/MSFT_20220922_20221230_1710.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220623_20220831_2390.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220623_20220831_2390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20211115_20220123_2170.png", "target_image": "/workspace/data/charts/full/BTC-USD_20211115_20220123_2170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20231102_20240213_1990.png", "target_image": "/workspace/data/charts/full/MSFT_20231102_20240213_1990.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250118_20250328_3330.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250118_20250328_3330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20241114_20250227_2250.png", "target_image": "/workspace/data/charts/full/SPY_20241114_20250227_2250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160531_20160907_120.png", "target_image": "/workspace/data/charts/full/MSFT_20160531_20160907_120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250512_20250820_2370.png", "target_image": "/workspace/data/charts/full/AAPL_20250512_20250820_2370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20211125_20220202_2180.png", "target_image": "/workspace/data/charts/full/BTC-USD_20211125_20220202_2180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20241017_20250129_2230.png", "target_image": "/workspace/data/charts/full/MSFT_20241017_20250129_2230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210205_20210517_1300.png", "target_image": "/workspace/data/charts/full/MSFT_20210205_20210517_1300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200914_20201221_1200.png", "target_image": "/workspace/data/charts/full/MSFT_20200914_20201221_1200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20171130_20180313_500.png", "target_image": "/workspace/data/charts/full/SPY_20171130_20180313_500.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230428_20230808_1860.png", "target_image": "/workspace/data/charts/full/AAPL_20230428_20230808_1860.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20231215_20240327_2020.png", "target_image": "/workspace/data/charts/full/SPY_20231215_20240327_2020.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250925_20251203_3580.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250925_20251203_3580.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20161006_20170117_210.png", "target_image": "/workspace/data/charts/full/MSFT_20161006_20170117_210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20211119_20220302_1500.png", "target_image": "/workspace/data/charts/full/SPY_20211119_20220302_1500.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20181101_20190109_1060.png", "target_image": "/workspace/data/charts/full/BTC-USD_20181101_20190109_1060.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160502_20160809_100.png", "target_image": "/workspace/data/charts/full/MSFT_20160502_20160809_100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220810_20221116_1680.png", "target_image": "/workspace/data/charts/full/SPY_20220810_20221116_1680.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180820_20181127_680.png", "target_image": "/workspace/data/charts/full/MSFT_20180820_20181127_680.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20241030_20250107_3250.png", "target_image": "/workspace/data/charts/full/BTC-USD_20241030_20250107_3250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160502_20160809_100.png", "target_image": "/workspace/data/charts/full/AAPL_20160502_20160809_100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20241213_20250327_2270.png", "target_image": "/workspace/data/charts/full/SPY_20241213_20250327_2270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20171226_20180305_750.png", "target_image": "/workspace/data/charts/full/BTC-USD_20171226_20180305_750.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20161121_20170129_350.png", "target_image": "/workspace/data/charts/full/BTC-USD_20161121_20170129_350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230526_20230906_1880.png", "target_image": "/workspace/data/charts/full/AAPL_20230526_20230906_1880.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20221103_20230214_1740.png", "target_image": "/workspace/data/charts/full/SPY_20221103_20230214_1740.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160624_20160901_200.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160624_20160901_200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240229_20240607_2070.png", "target_image": "/workspace/data/charts/full/AAPL_20240229_20240607_2070.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210812_20211118_1430.png", "target_image": "/workspace/data/charts/full/MSFT_20210812_20211118_1430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220104_20220314_2220.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220104_20220314_2220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170526_20170905_370.png", "target_image": "/workspace/data/charts/full/MSFT_20170526_20170905_370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200702_20201009_1150.png", "target_image": "/workspace/data/charts/full/SPY_20200702_20201009_1150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240412_20240723_2100.png", "target_image": "/workspace/data/charts/full/AAPL_20240412_20240723_2100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220628_20221005_1650.png", "target_image": "/workspace/data/charts/full/MSFT_20220628_20221005_1650.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210924_20220103_1460.png", "target_image": "/workspace/data/charts/full/MSFT_20210924_20220103_1460.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160727_20161102_160.png", "target_image": "/workspace/data/charts/full/MSFT_20160727_20161102_160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20231205_20240212_2920.png", "target_image": "/workspace/data/charts/full/BTC-USD_20231205_20240212_2920.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220223_20220503_2270.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220223_20220503_2270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190509_20190816_860.png", "target_image": "/workspace/data/charts/full/SPY_20190509_20190816_860.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20171214_20180327_510.png", "target_image": "/workspace/data/charts/full/AAPL_20171214_20180327_510.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200928_20210106_1210.png", "target_image": "/workspace/data/charts/full/MSFT_20200928_20210106_1210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250707_20250914_3500.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250707_20250914_3500.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220303_20220610_1570.png", "target_image": "/workspace/data/charts/full/MSFT_20220303_20220610_1570.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160425_20160703_140.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160425_20160703_140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20171018_20180129_470.png", "target_image": "/workspace/data/charts/full/AAPL_20171018_20180129_470.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180515_20180723_890.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180515_20180723_890.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190510_20190718_1250.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190510_20190718_1250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160922_20161130_290.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160922_20161130_290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210205_20210517_1300.png", "target_image": "/workspace/data/charts/full/SPY_20210205_20210517_1300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20221006_20230117_1720.png", "target_image": "/workspace/data/charts/full/SPY_20221006_20230117_1720.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20171206_20180213_730.png", "target_image": "/workspace/data/charts/full/BTC-USD_20171206_20180213_730.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190410_20190719_840.png", "target_image": "/workspace/data/charts/full/MSFT_20190410_20190719_840.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170526_20170905_370.png", "target_image": "/workspace/data/charts/full/SPY_20170526_20170905_370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170917_20171125_650.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170917_20171125_650.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170920_20171228_450.png", "target_image": "/workspace/data/charts/full/AAPL_20170920_20171228_450.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20241230_20250410_2280.png", "target_image": "/workspace/data/charts/full/SPY_20241230_20250410_2280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200224_20200503_1540.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200224_20200503_1540.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160304_20160613_60.png", "target_image": "/workspace/data/charts/full/MSFT_20160304_20160613_60.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240610_20240918_2140.png", "target_image": "/workspace/data/charts/full/AAPL_20240610_20240918_2140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160418_20160726_90.png", "target_image": "/workspace/data/charts/full/MSFT_20160418_20160726_90.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180524_20180831_620.png", "target_image": "/workspace/data/charts/full/MSFT_20180524_20180831_620.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180426_20180803_600.png", "target_image": "/workspace/data/charts/full/AAPL_20180426_20180803_600.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190425_20190802_850.png", "target_image": "/workspace/data/charts/full/MSFT_20190425_20190802_850.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250329_20250606_3400.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250329_20250606_3400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240920_20241128_3210.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240920_20241128_3210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20211105_20220215_1490.png", "target_image": "/workspace/data/charts/full/AAPL_20211105_20220215_1490.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180314_20180621_570.png", "target_image": "/workspace/data/charts/full/MSFT_20180314_20180621_570.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220613_20220821_2380.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220613_20220821_2380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20161111_20170119_340.png", "target_image": "/workspace/data/charts/full/BTC-USD_20161111_20170119_340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20191029_20200207_980.png", "target_image": "/workspace/data/charts/full/AAPL_20191029_20200207_980.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20171106_20180114_700.png", "target_image": "/workspace/data/charts/full/BTC-USD_20171106_20180114_700.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190321_20190529_1200.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190321_20190529_1200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210718_20210925_2050.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210718_20210925_2050.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20231201_20240313_2010.png", "target_image": "/workspace/data/charts/full/SPY_20231201_20240313_2010.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220727_20221102_1670.png", "target_image": "/workspace/data/charts/full/MSFT_20220727_20221102_1670.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20181113_20190226_740.png", "target_image": "/workspace/data/charts/full/MSFT_20181113_20190226_740.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20231102_20240213_1990.png", "target_image": "/workspace/data/charts/full/AAPL_20231102_20240213_1990.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20191001_20200109_960.png", "target_image": "/workspace/data/charts/full/MSFT_20191001_20200109_960.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20211215_20220222_2200.png", "target_image": "/workspace/data/charts/full/BTC-USD_20211215_20220222_2200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20191112_20200224_990.png", "target_image": "/workspace/data/charts/full/SPY_20191112_20200224_990.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210817_20211025_2080.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210817_20211025_2080.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250724_20251030_2420.png", "target_image": "/workspace/data/charts/full/MSFT_20250724_20251030_2420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200828_20201207_1190.png", "target_image": "/workspace/data/charts/full/SPY_20200828_20201207_1190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20191001_20200109_960.png", "target_image": "/workspace/data/charts/full/AAPL_20191001_20200109_960.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20231116_20240228_2000.png", "target_image": "/workspace/data/charts/full/AAPL_20231116_20240228_2000.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210420_20210728_1350.png", "target_image": "/workspace/data/charts/full/AAPL_20210420_20210728_1350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200310_20200617_1070.png", "target_image": "/workspace/data/charts/full/AAPL_20200310_20200617_1070.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20191015_20200124_970.png", "target_image": "/workspace/data/charts/full/SPY_20191015_20200124_970.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250130_20250509_2300.png", "target_image": "/workspace/data/charts/full/MSFT_20250130_20250509_2300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220325_20220602_2300.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220325_20220602_2300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180904_20181212_690.png", "target_image": "/workspace/data/charts/full/AAPL_20180904_20181212_690.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170711_20171017_400.png", "target_image": "/workspace/data/charts/full/SPY_20170711_20171017_400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230907_20231214_1950.png", "target_image": "/workspace/data/charts/full/AAPL_20230907_20231214_1950.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20191027_20200104_1420.png", "target_image": "/workspace/data/charts/full/BTC-USD_20191027_20200104_1420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190619_20190827_1290.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190619_20190827_1290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200225_20200603_1060.png", "target_image": "/workspace/data/charts/full/AAPL_20200225_20200603_1060.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20161201_20170208_360.png", "target_image": "/workspace/data/charts/full/BTC-USD_20161201_20170208_360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220119_20220428_1540.png", "target_image": "/workspace/data/charts/full/AAPL_20220119_20220428_1540.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200618_20200925_1140.png", "target_image": "/workspace/data/charts/full/MSFT_20200618_20200925_1140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210322_20210629_1330.png", "target_image": "/workspace/data/charts/full/MSFT_20210322_20210629_1330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20151207_20160317_0.png", "target_image": "/workspace/data/charts/full/MSFT_20151207_20160317_0.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20151221_20160401_10.png", "target_image": "/workspace/data/charts/full/SPY_20151221_20160401_10.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230608_20230816_2740.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230608_20230816_2740.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190523_20190830_870.png", "target_image": "/workspace/data/charts/full/AAPL_20190523_20190830_870.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200204_20200413_1520.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200204_20200413_1520.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250821_20251128_2440.png", "target_image": "/workspace/data/charts/full/AAPL_20250821_20251128_2440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220527_20220907_1630.png", "target_image": "/workspace/data/charts/full/MSFT_20220527_20220907_1630.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160912_20161120_280.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160912_20161120_280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20221202_20230315_1760.png", "target_image": "/workspace/data/charts/full/MSFT_20221202_20230315_1760.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20221020_20230131_1730.png", "target_image": "/workspace/data/charts/full/SPY_20221020_20230131_1730.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20161202_20170315_250.png", "target_image": "/workspace/data/charts/full/AAPL_20161202_20170315_250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160121_20160429_30.png", "target_image": "/workspace/data/charts/full/SPY_20160121_20160429_30.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220104_20220413_1530.png", "target_image": "/workspace/data/charts/full/AAPL_20220104_20220413_1530.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220908_20221215_1700.png", "target_image": "/workspace/data/charts/full/MSFT_20220908_20221215_1700.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20241129_20250206_3280.png", "target_image": "/workspace/data/charts/full/BTC-USD_20241129_20250206_3280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210107_20210419_1280.png", "target_image": "/workspace/data/charts/full/SPY_20210107_20210419_1280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230509_20230717_2710.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230509_20230717_2710.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20241219_20250226_3300.png", "target_image": "/workspace/data/charts/full/BTC-USD_20241219_20250226_3300.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170906_20171213_440.png", "target_image": "/workspace/data/charts/full/MSFT_20170906_20171213_440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230330_20230711_1840.png", "target_image": "/workspace/data/charts/full/SPY_20230330_20230711_1840.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160713_20161019_150.png", "target_image": "/workspace/data/charts/full/SPY_20160713_20161019_150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190708_20191014_900.png", "target_image": "/workspace/data/charts/full/MSFT_20190708_20191014_900.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180902_20181110_1000.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180902_20181110_1000.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200828_20201207_1190.png", "target_image": "/workspace/data/charts/full/AAPL_20200828_20201207_1190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250527_20250904_2380.png", "target_image": "/workspace/data/charts/full/AAPL_20250527_20250904_2380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170118_20170427_280.png", "target_image": "/workspace/data/charts/full/SPY_20170118_20170427_280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160824_20161201_180.png", "target_image": "/workspace/data/charts/full/AAPL_20160824_20161201_180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240821_20241127_2190.png", "target_image": "/workspace/data/charts/full/SPY_20240821_20241127_2190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180328_20180706_580.png", "target_image": "/workspace/data/charts/full/SPY_20180328_20180706_580.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180328_20180706_580.png", "target_image": "/workspace/data/charts/full/MSFT_20180328_20180706_580.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190327_20190705_830.png", "target_image": "/workspace/data/charts/full/MSFT_20190327_20190705_830.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240919_20241227_2210.png", "target_image": "/workspace/data/charts/full/SPY_20240919_20241227_2210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20221117_20230301_1750.png", "target_image": "/workspace/data/charts/full/MSFT_20221117_20230301_1750.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240513_20240721_3080.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240513_20240721_3080.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220104_20220413_1530.png", "target_image": "/workspace/data/charts/full/MSFT_20220104_20220413_1530.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20250428_20250806_2360.png", "target_image": "/workspace/data/charts/full/SPY_20250428_20250806_2360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20241114_20250227_2250.png", "target_image": "/workspace/data/charts/full/MSFT_20241114_20250227_2250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230118_20230427_1790.png", "target_image": "/workspace/data/charts/full/AAPL_20230118_20230427_1790.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190917_20191224_950.png", "target_image": "/workspace/data/charts/full/AAPL_20190917_20191224_950.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250821_20251128_2440.png", "target_image": "/workspace/data/charts/full/MSFT_20250821_20251128_2440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20181121_20190129_1080.png", "target_image": "/workspace/data/charts/full/BTC-USD_20181121_20190129_1080.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160614_20160921_130.png", "target_image": "/workspace/data/charts/full/SPY_20160614_20160921_130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220713_20220920_2410.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220713_20220920_2410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170920_20171228_450.png", "target_image": "/workspace/data/charts/full/SPY_20170920_20171228_450.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160823_20161031_260.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160823_20161031_260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20181128_20190312_750.png", "target_image": "/workspace/data/charts/full/AAPL_20181128_20190312_750.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20231215_20240222_2930.png", "target_image": "/workspace/data/charts/full/BTC-USD_20231215_20240222_2930.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170822_20171129_430.png", "target_image": "/workspace/data/charts/full/AAPL_20170822_20171129_430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20221216_20230329_1770.png", "target_image": "/workspace/data/charts/full/AAPL_20221216_20230329_1770.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180306_20180514_820.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180306_20180514_820.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20211022_20220201_1480.png", "target_image": "/workspace/data/charts/full/MSFT_20211022_20220201_1480.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250627_20250904_3490.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250627_20250904_3490.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200127_20200505_1040.png", "target_image": "/workspace/data/charts/full/MSFT_20200127_20200505_1040.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170626_20171003_390.png", "target_image": "/workspace/data/charts/full/SPY_20170626_20171003_390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230823_20231130_1940.png", "target_image": "/workspace/data/charts/full/SPY_20230823_20231130_1940.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20211008_20220118_1470.png", "target_image": "/workspace/data/charts/full/AAPL_20211008_20220118_1470.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170413_20170724_340.png", "target_image": "/workspace/data/charts/full/AAPL_20170413_20170724_340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20181016_20190128_720.png", "target_image": "/workspace/data/charts/full/MSFT_20181016_20190128_720.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200127_20200505_1040.png", "target_image": "/workspace/data/charts/full/SPY_20200127_20200505_1040.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180130_20180509_540.png", "target_image": "/workspace/data/charts/full/AAPL_20180130_20180509_540.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20171101_20180212_480.png", "target_image": "/workspace/data/charts/full/MSFT_20171101_20180212_480.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180918_20181227_700.png", "target_image": "/workspace/data/charts/full/SPY_20180918_20181227_700.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160531_20160907_120.png", "target_image": "/workspace/data/charts/full/AAPL_20160531_20160907_120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160204_20160513_40.png", "target_image": "/workspace/data/charts/full/SPY_20160204_20160513_40.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160225_20160504_80.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160225_20160504_80.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170526_20170905_370.png", "target_image": "/workspace/data/charts/full/AAPL_20170526_20170905_370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20201222_20210405_1270.png", "target_image": "/workspace/data/charts/full/MSFT_20201222_20210405_1270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170512_20170821_360.png", "target_image": "/workspace/data/charts/full/AAPL_20170512_20170821_360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210630_20211007_1400.png", "target_image": "/workspace/data/charts/full/AAPL_20210630_20211007_1400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210807_20211015_2070.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210807_20211015_2070.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230827_20231104_2820.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230827_20231104_2820.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20211220_20220330_1520.png", "target_image": "/workspace/data/charts/full/MSFT_20211220_20220330_1520.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170413_20170724_340.png", "target_image": "/workspace/data/charts/full/MSFT_20170413_20170724_340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210812_20211118_1430.png", "target_image": "/workspace/data/charts/full/SPY_20210812_20211118_1430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20191226_20200406_1020.png", "target_image": "/workspace/data/charts/full/MSFT_20191226_20200406_1020.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250207_20250417_3350.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250207_20250417_3350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20211119_20220302_1500.png", "target_image": "/workspace/data/charts/full/MSFT_20211119_20220302_1500.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210107_20210419_1280.png", "target_image": "/workspace/data/charts/full/MSFT_20210107_20210419_1280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170428_20170807_350.png", "target_image": "/workspace/data/charts/full/SPY_20170428_20170807_350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20231019_20240130_1980.png", "target_image": "/workspace/data/charts/full/SPY_20231019_20240130_1980.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250217_20250427_3360.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250217_20250427_3360.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20190425_20190802_850.png", "target_image": "/workspace/data/charts/full/AAPL_20190425_20190802_850.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20231215_20240327_2020.png", "target_image": "/workspace/data/charts/full/MSFT_20231215_20240327_2020.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20171229_20180411_520.png", "target_image": "/workspace/data/charts/full/AAPL_20171229_20180411_520.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160727_20161102_160.png", "target_image": "/workspace/data/charts/full/SPY_20160727_20161102_160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160204_20160513_40.png", "target_image": "/workspace/data/charts/full/AAPL_20160204_20160513_40.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240622_20240830_3120.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240622_20240830_3120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20181016_20190128_720.png", "target_image": "/workspace/data/charts/full/SPY_20181016_20190128_720.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170103_20170412_270.png", "target_image": "/workspace/data/charts/full/MSFT_20170103_20170412_270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240821_20241127_2190.png", "target_image": "/workspace/data/charts/full/AAPL_20240821_20241127_2190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230320_20230528_2660.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230320_20230528_2660.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20201001_20201209_1760.png", "target_image": "/workspace/data/charts/full/BTC-USD_20201001_20201209_1760.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190313_20190620_820.png", "target_image": "/workspace/data/charts/full/MSFT_20190313_20190620_820.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190818_20191026_1350.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190818_20191026_1350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20190621_20190930_890.png", "target_image": "/workspace/data/charts/full/MSFT_20190621_20190930_890.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20161020_20170131_220.png", "target_image": "/workspace/data/charts/full/MSFT_20161020_20170131_220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190311_20190519_1190.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190311_20190519_1190.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20241114_20250227_2250.png", "target_image": "/workspace/data/charts/full/AAPL_20241114_20250227_2250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200210_20200519_1050.png", "target_image": "/workspace/data/charts/full/SPY_20200210_20200519_1050.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210602_20210909_1380.png", "target_image": "/workspace/data/charts/full/SPY_20210602_20210909_1380.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230310_20230518_2650.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230310_20230518_2650.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230414_20230725_1850.png", "target_image": "/workspace/data/charts/full/SPY_20230414_20230725_1850.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190907_20191115_1370.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190907_20191115_1370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200115_20200324_1500.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200115_20200324_1500.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20200731_20201106_1170.png", "target_image": "/workspace/data/charts/full/MSFT_20200731_20201106_1170.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200407_20200716_1090.png", "target_image": "/workspace/data/charts/full/SPY_20200407_20200716_1090.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20211206_20220316_1510.png", "target_image": "/workspace/data/charts/full/MSFT_20211206_20220316_1510.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20180213_20180523_550.png", "target_image": "/workspace/data/charts/full/AAPL_20180213_20180523_550.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20201123_20210305_1250.png", "target_image": "/workspace/data/charts/full/AAPL_20201123_20210305_1250.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230712_20231018_1910.png", "target_image": "/workspace/data/charts/full/AAPL_20230712_20231018_1910.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230708_20230915_2770.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230708_20230915_2770.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220202_20220512_1550.png", "target_image": "/workspace/data/charts/full/MSFT_20220202_20220512_1550.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200713_20200920_1680.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200713_20200920_1680.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240510_20240820_2120.png", "target_image": "/workspace/data/charts/full/SPY_20240510_20240820_2120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20190621_20190930_890.png", "target_image": "/workspace/data/charts/full/SPY_20190621_20190930_890.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160318_20160627_70.png", "target_image": "/workspace/data/charts/full/AAPL_20160318_20160627_70.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200210_20200519_1050.png", "target_image": "/workspace/data/charts/full/AAPL_20200210_20200519_1050.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170201_20170511_290.png", "target_image": "/workspace/data/charts/full/SPY_20170201_20170511_290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230526_20230906_1880.png", "target_image": "/workspace/data/charts/full/SPY_20230526_20230906_1880.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240930_20241208_3220.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240930_20241208_3220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200504_20200712_1610.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200504_20200712_1610.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170629_20170906_570.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170629_20170906_570.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170609_20170817_550.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170609_20170817_550.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250228_20250609_2320.png", "target_image": "/workspace/data/charts/full/AAPL_20250228_20250609_2320.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20180213_20180523_550.png", "target_image": "/workspace/data/charts/full/MSFT_20180213_20180523_550.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210618_20210826_2020.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210618_20210826_2020.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240919_20241227_2210.png", "target_image": "/workspace/data/charts/full/AAPL_20240919_20241227_2210.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250607_20250815_3470.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250607_20250815_3470.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240229_20240607_2070.png", "target_image": "/workspace/data/charts/full/SPY_20240229_20240607_2070.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250617_20250825_3480.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250617_20250825_3480.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20241003_20250114_2220.png", "target_image": "/workspace/data/charts/full/MSFT_20241003_20250114_2220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20161216_20170329_260.png", "target_image": "/workspace/data/charts/full/MSFT_20161216_20170329_260.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20200702_20201009_1150.png", "target_image": "/workspace/data/charts/full/AAPL_20200702_20201009_1150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160318_20160627_70.png", "target_image": "/workspace/data/charts/full/SPY_20160318_20160627_70.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240625_20241002_2150.png", "target_image": "/workspace/data/charts/full/SPY_20240625_20241002_2150.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20231016_20231224_2870.png", "target_image": "/workspace/data/charts/full/BTC-USD_20231016_20231224_2870.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170302_20170609_310.png", "target_image": "/workspace/data/charts/full/SPY_20170302_20170609_310.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170130_20170409_420.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170130_20170409_420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250710_20251016_2410.png", "target_image": "/workspace/data/charts/full/MSFT_20250710_20251016_2410.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20201026_20210204_1230.png", "target_image": "/workspace/data/charts/full/MSFT_20201026_20210204_1230.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220429_20220809_1610.png", "target_image": "/workspace/data/charts/full/MSFT_20220429_20220809_1610.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20231225_20240303_2940.png", "target_image": "/workspace/data/charts/full/BTC-USD_20231225_20240303_2940.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210910_20211217_1450.png", "target_image": "/workspace/data/charts/full/AAPL_20210910_20211217_1450.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20210529_20210806_2000.png", "target_image": "/workspace/data/charts/full/BTC-USD_20210529_20210806_2000.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20170430_20170708_510.png", "target_image": "/workspace/data/charts/full/BTC-USD_20170430_20170708_510.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20181211_20190218_1100.png", "target_image": "/workspace/data/charts/full/BTC-USD_20181211_20190218_1100.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220513_20220823_1620.png", "target_image": "/workspace/data/charts/full/SPY_20220513_20220823_1620.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240710_20241016_2160.png", "target_image": "/workspace/data/charts/full/SPY_20240710_20241016_2160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20211008_20220118_1470.png", "target_image": "/workspace/data/charts/full/SPY_20211008_20220118_1470.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230302_20230609_1820.png", "target_image": "/workspace/data/charts/full/MSFT_20230302_20230609_1820.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20210518_20210825_1370.png", "target_image": "/workspace/data/charts/full/SPY_20210518_20210825_1370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240712_20240919_3140.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240712_20240919_3140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180823_20181031_990.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180823_20181031_990.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20201222_20210405_1270.png", "target_image": "/workspace/data/charts/full/AAPL_20201222_20210405_1270.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170626_20171003_390.png", "target_image": "/workspace/data/charts/full/MSFT_20170626_20171003_390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250717_20250924_3510.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250717_20250924_3510.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180214_20180424_800.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180214_20180424_800.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20210826_20211203_1440.png", "target_image": "/workspace/data/charts/full/AAPL_20210826_20211203_1440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190301_20190509_1180.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190301_20190509_1180.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20230428_20230808_1860.png", "target_image": "/workspace/data/charts/full/SPY_20230428_20230808_1860.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160318_20160627_70.png", "target_image": "/workspace/data/charts/full/MSFT_20160318_20160627_70.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20201031_20210108_1790.png", "target_image": "/workspace/data/charts/full/BTC-USD_20201031_20210108_1790.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20240214_20240523_2060.png", "target_image": "/workspace/data/charts/full/SPY_20240214_20240523_2060.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20240214_20240523_2060.png", "target_image": "/workspace/data/charts/full/AAPL_20240214_20240523_2060.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160204_20160513_40.png", "target_image": "/workspace/data/charts/full/MSFT_20160204_20160513_40.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20230119_20230329_2600.png", "target_image": "/workspace/data/charts/full/BTC-USD_20230119_20230329_2600.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20200520_20200827_1120.png", "target_image": "/workspace/data/charts/full/SPY_20200520_20200827_1120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20180624_20180901_930.png", "target_image": "/workspace/data/charts/full/BTC-USD_20180624_20180901_930.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200514_20200722_1620.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200514_20200722_1620.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190209_20190419_1160.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190209_20190419_1160.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230330_20230711_1840.png", "target_image": "/workspace/data/charts/full/AAPL_20230330_20230711_1840.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20241003_20250114_2220.png", "target_image": "/workspace/data/charts/full/SPY_20241003_20250114_2220.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170906_20171213_440.png", "target_image": "/workspace/data/charts/full/AAPL_20170906_20171213_440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20170118_20170427_280.png", "target_image": "/workspace/data/charts/full/AAPL_20170118_20170427_280.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170822_20171129_430.png", "target_image": "/workspace/data/charts/full/SPY_20170822_20171129_430.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20240304_20240512_3010.png", "target_image": "/workspace/data/charts/full/BTC-USD_20240304_20240512_3010.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20160614_20160921_130.png", "target_image": "/workspace/data/charts/full/MSFT_20160614_20160921_130.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250411_20250723_2350.png", "target_image": "/workspace/data/charts/full/AAPL_20250411_20250723_2350.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20160219_20160527_50.png", "target_image": "/workspace/data/charts/full/SPY_20160219_20160527_50.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20250227_20250507_3370.png", "target_image": "/workspace/data/charts/full/BTC-USD_20250227_20250507_3370.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20201109_20210219_1240.png", "target_image": "/workspace/data/charts/full/AAPL_20201109_20210219_1240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160116_20160325_40.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160116_20160325_40.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20160803_20161011_240.png", "target_image": "/workspace/data/charts/full/BTC-USD_20160803_20161011_240.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180806_20181112_670.png", "target_image": "/workspace/data/charts/full/SPY_20180806_20181112_670.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20220303_20220610_1570.png", "target_image": "/workspace/data/charts/full/AAPL_20220303_20220610_1570.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20230414_20230725_1850.png", "target_image": "/workspace/data/charts/full/MSFT_20230414_20230725_1850.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20181221_20190228_1110.png", "target_image": "/workspace/data/charts/full/BTC-USD_20181221_20190228_1110.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170413_20170724_340.png", "target_image": "/workspace/data/charts/full/SPY_20170413_20170724_340.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20250314_20250624_2330.png", "target_image": "/workspace/data/charts/full/MSFT_20250314_20250624_2330.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200125_20200403_1510.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200125_20200403_1510.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180820_20181127_680.png", "target_image": "/workspace/data/charts/full/SPY_20180820_20181127_680.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20181012_20181220_1040.png", "target_image": "/workspace/data/charts/full/BTC-USD_20181012_20181220_1040.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20210616_20210923_1390.png", "target_image": "/workspace/data/charts/full/MSFT_20210616_20210923_1390.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20250115_20250425_2290.png", "target_image": "/workspace/data/charts/full/AAPL_20250115_20250425_2290.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20220119_20220428_1540.png", "target_image": "/workspace/data/charts/full/MSFT_20220119_20220428_1540.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20160922_20161230_200.png", "target_image": "/workspace/data/charts/full/AAPL_20160922_20161230_200.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20180116_20180425_530.png", "target_image": "/workspace/data/charts/full/SPY_20180116_20180425_530.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20211105_20220215_1490.png", "target_image": "/workspace/data/charts/full/SPY_20211105_20220215_1490.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20220703_20220910_2400.png", "target_image": "/workspace/data/charts/full/BTC-USD_20220703_20220910_2400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20191029_20200207_980.png", "target_image": "/workspace/data/charts/full/MSFT_20191029_20200207_980.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20191116_20200124_1440.png", "target_image": "/workspace/data/charts/full/BTC-USD_20191116_20200124_1440.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20220527_20220907_1630.png", "target_image": "/workspace/data/charts/full/SPY_20220527_20220907_1630.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20170808_20171114_420.png", "target_image": "/workspace/data/charts/full/SPY_20170808_20171114_420.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20181231_20190310_1120.png", "target_image": "/workspace/data/charts/full/BTC-USD_20181231_20190310_1120.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20190120_20190330_1140.png", "target_image": "/workspace/data/charts/full/BTC-USD_20190120_20190330_1140.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/AAPL_20230302_20230609_1820.png", "target_image": "/workspace/data/charts/full/AAPL_20230302_20230609_1820.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/MSFT_20170711_20171017_400.png", "target_image": "/workspace/data/charts/full/MSFT_20170711_20171017_400.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20200603_20200811_1640.png", "target_image": "/workspace/data/charts/full/BTC-USD_20200603_20200811_1640.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/SPY_20171004_20180112_460.png", "target_image": "/workspace/data/charts/full/SPY_20171004_20180112_460.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} +{"source_image": "/workspace/data/charts/hist/BTC-USD_20221021_20221229_2510.png", "target_image": "/workspace/data/charts/full/BTC-USD_20221021_20221229_2510.png", "instruction": "根据左侧历史K线走势,绘制后续10根K线的可能走势并显示在右侧区域。"} diff --git a/fin-mm/data/charts/full/AAPL_20151207_20160317_0.png b/fin-mm/data/charts/full/AAPL_20151207_20160317_0.png new file mode 100644 index 0000000000000000000000000000000000000000..7e3471d5b7ca35b8b8e03ff573429cde5940271a Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20151207_20160317_0.png differ diff --git a/fin-mm/data/charts/full/AAPL_20151221_20160401_10.png b/fin-mm/data/charts/full/AAPL_20151221_20160401_10.png new file mode 100644 index 0000000000000000000000000000000000000000..680a1de6d2187a627595214afdd3a80687d17650 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20151221_20160401_10.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160106_20160415_20.png b/fin-mm/data/charts/full/AAPL_20160106_20160415_20.png new file mode 100644 index 0000000000000000000000000000000000000000..9b9984a33651434583fd02617ff3324e47057a90 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160106_20160415_20.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160121_20160429_30.png b/fin-mm/data/charts/full/AAPL_20160121_20160429_30.png new file mode 100644 index 0000000000000000000000000000000000000000..d973701559a2b873db461280507f63d58679ed36 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160121_20160429_30.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160204_20160513_40.png b/fin-mm/data/charts/full/AAPL_20160204_20160513_40.png new file mode 100644 index 0000000000000000000000000000000000000000..f33b7c1dee99ef6e61f5e3d176d1689e4898b277 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160204_20160513_40.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160219_20160527_50.png b/fin-mm/data/charts/full/AAPL_20160219_20160527_50.png new file mode 100644 index 0000000000000000000000000000000000000000..0e71966adb58df991481556ffc6bd69ed0c0b07b Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160219_20160527_50.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160304_20160613_60.png b/fin-mm/data/charts/full/AAPL_20160304_20160613_60.png new file mode 100644 index 0000000000000000000000000000000000000000..f93f227e7b4fa7117cc77814655178c3cbe95d11 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160304_20160613_60.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160318_20160627_70.png b/fin-mm/data/charts/full/AAPL_20160318_20160627_70.png new file mode 100644 index 0000000000000000000000000000000000000000..4115cf74d16ddc7083605f1dc15799c82c6056d1 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160318_20160627_70.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160404_20160712_80.png b/fin-mm/data/charts/full/AAPL_20160404_20160712_80.png new file mode 100644 index 0000000000000000000000000000000000000000..7083f7016f54507f8e885c32f1cbde664483a275 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160404_20160712_80.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160418_20160726_90.png b/fin-mm/data/charts/full/AAPL_20160418_20160726_90.png new file mode 100644 index 0000000000000000000000000000000000000000..5daa077d1c11c887c16653e2d1ebc8fbe16b2dc8 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160418_20160726_90.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160502_20160809_100.png b/fin-mm/data/charts/full/AAPL_20160502_20160809_100.png new file mode 100644 index 0000000000000000000000000000000000000000..f899a6550b9c9fe4c83176ce44db991bf705910d Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160502_20160809_100.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160516_20160823_110.png b/fin-mm/data/charts/full/AAPL_20160516_20160823_110.png new file mode 100644 index 0000000000000000000000000000000000000000..dde62cc83a4fcd2bb4c7d2a4981e1edf9d65abed Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160516_20160823_110.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160531_20160907_120.png b/fin-mm/data/charts/full/AAPL_20160531_20160907_120.png new file mode 100644 index 0000000000000000000000000000000000000000..26a754b43d5892d8630343965d3b752b98e615fb Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160531_20160907_120.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160614_20160921_130.png b/fin-mm/data/charts/full/AAPL_20160614_20160921_130.png new file mode 100644 index 0000000000000000000000000000000000000000..e302e75cd14f827ec1f252adb312f3bdedf69674 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160614_20160921_130.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160628_20161005_140.png b/fin-mm/data/charts/full/AAPL_20160628_20161005_140.png new file mode 100644 index 0000000000000000000000000000000000000000..0cdeef0a0f1f09e6b8c22ffb58db836835b9e317 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160628_20161005_140.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160713_20161019_150.png b/fin-mm/data/charts/full/AAPL_20160713_20161019_150.png new file mode 100644 index 0000000000000000000000000000000000000000..810c04a42ec034737ad5d365310c83ebb478b8c6 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160713_20161019_150.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160727_20161102_160.png b/fin-mm/data/charts/full/AAPL_20160727_20161102_160.png new file mode 100644 index 0000000000000000000000000000000000000000..a14baf4f7cf8afc400065f3f76a0edbb7f46b563 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160727_20161102_160.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160810_20161116_170.png b/fin-mm/data/charts/full/AAPL_20160810_20161116_170.png new file mode 100644 index 0000000000000000000000000000000000000000..19134e0d01f45ce3b62a1288f50e24c3b49b7e60 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160810_20161116_170.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160824_20161201_180.png b/fin-mm/data/charts/full/AAPL_20160824_20161201_180.png new file mode 100644 index 0000000000000000000000000000000000000000..028fba8c4f776a27a4ce6106b22099b3d92ca8d9 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160824_20161201_180.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160908_20161215_190.png b/fin-mm/data/charts/full/AAPL_20160908_20161215_190.png new file mode 100644 index 0000000000000000000000000000000000000000..be639236ca5438fde0296161c3d8ae2ac13e7e40 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160908_20161215_190.png differ diff --git a/fin-mm/data/charts/full/AAPL_20160922_20161230_200.png b/fin-mm/data/charts/full/AAPL_20160922_20161230_200.png new file mode 100644 index 0000000000000000000000000000000000000000..60700f115d62c9d8d0e49bd7a78d1c6bb7f0f6bf Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20160922_20161230_200.png differ diff --git a/fin-mm/data/charts/full/AAPL_20161006_20170117_210.png b/fin-mm/data/charts/full/AAPL_20161006_20170117_210.png new file mode 100644 index 0000000000000000000000000000000000000000..e04679d2a4c41a72d57c692bc93011d6a0866bd1 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20161006_20170117_210.png differ diff --git a/fin-mm/data/charts/full/AAPL_20161020_20170131_220.png b/fin-mm/data/charts/full/AAPL_20161020_20170131_220.png new file mode 100644 index 0000000000000000000000000000000000000000..82c30e81186451057a108be31733535f5fda741a Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20161020_20170131_220.png differ diff --git a/fin-mm/data/charts/full/AAPL_20161103_20170214_230.png b/fin-mm/data/charts/full/AAPL_20161103_20170214_230.png new file mode 100644 index 0000000000000000000000000000000000000000..eddb8325d4b44dfc5dcf8cbc77e3de23a2ea5087 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20161103_20170214_230.png differ diff --git a/fin-mm/data/charts/full/AAPL_20161117_20170301_240.png b/fin-mm/data/charts/full/AAPL_20161117_20170301_240.png new file mode 100644 index 0000000000000000000000000000000000000000..e271d40d219f6fa00e3098098cc75fc0f6b1beb2 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20161117_20170301_240.png differ diff --git a/fin-mm/data/charts/full/AAPL_20161202_20170315_250.png b/fin-mm/data/charts/full/AAPL_20161202_20170315_250.png new file mode 100644 index 0000000000000000000000000000000000000000..f18a704894bf664714685b3cf7051e2c8910dc5a Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20161202_20170315_250.png differ diff --git a/fin-mm/data/charts/full/AAPL_20161216_20170329_260.png b/fin-mm/data/charts/full/AAPL_20161216_20170329_260.png new file mode 100644 index 0000000000000000000000000000000000000000..d13c1d78b96f34a4adb81c407eed6758cfb5462d Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20161216_20170329_260.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170103_20170412_270.png b/fin-mm/data/charts/full/AAPL_20170103_20170412_270.png new file mode 100644 index 0000000000000000000000000000000000000000..f366b50ec1165a5a0a04b3786c9627d0d61686e8 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170103_20170412_270.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170118_20170427_280.png b/fin-mm/data/charts/full/AAPL_20170118_20170427_280.png new file mode 100644 index 0000000000000000000000000000000000000000..17dca997a92ade0f1838fad90e0b051a0162e849 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170118_20170427_280.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170201_20170511_290.png b/fin-mm/data/charts/full/AAPL_20170201_20170511_290.png new file mode 100644 index 0000000000000000000000000000000000000000..79dc4662ea2c1b1ec1e7567ffbca798eedf29110 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170201_20170511_290.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170215_20170525_300.png b/fin-mm/data/charts/full/AAPL_20170215_20170525_300.png new file mode 100644 index 0000000000000000000000000000000000000000..4a474658c5c6b45eb56eb66aaa87db59248aa4e6 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170215_20170525_300.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170302_20170609_310.png b/fin-mm/data/charts/full/AAPL_20170302_20170609_310.png new file mode 100644 index 0000000000000000000000000000000000000000..5b56073a46e1969fbeed3481314bc84906745af1 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170302_20170609_310.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170316_20170623_320.png b/fin-mm/data/charts/full/AAPL_20170316_20170623_320.png new file mode 100644 index 0000000000000000000000000000000000000000..9b9082fbf639813ace288c0a0425b1da7fc66843 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170316_20170623_320.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170330_20170710_330.png b/fin-mm/data/charts/full/AAPL_20170330_20170710_330.png new file mode 100644 index 0000000000000000000000000000000000000000..7266ea6956a719d81583741149efbdb3815747e1 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170330_20170710_330.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170413_20170724_340.png b/fin-mm/data/charts/full/AAPL_20170413_20170724_340.png new file mode 100644 index 0000000000000000000000000000000000000000..058da4388c652e24e062bebf8880ed193ac8c567 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170413_20170724_340.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170428_20170807_350.png b/fin-mm/data/charts/full/AAPL_20170428_20170807_350.png new file mode 100644 index 0000000000000000000000000000000000000000..80cb6c3280ef600bf9d09b0ed689e55ef08cca76 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170428_20170807_350.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170512_20170821_360.png b/fin-mm/data/charts/full/AAPL_20170512_20170821_360.png new file mode 100644 index 0000000000000000000000000000000000000000..fbaaa35f3775c4f80bad7b5b1074c25c6b23c6ef Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170512_20170821_360.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170526_20170905_370.png b/fin-mm/data/charts/full/AAPL_20170526_20170905_370.png new file mode 100644 index 0000000000000000000000000000000000000000..3019ad1dd35bf51d086de274edc665a824013b3a Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170526_20170905_370.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170612_20170919_380.png b/fin-mm/data/charts/full/AAPL_20170612_20170919_380.png new file mode 100644 index 0000000000000000000000000000000000000000..2aff99bacd702dbd4ff9da59a6f89d0e77d5f4e9 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170612_20170919_380.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170626_20171003_390.png b/fin-mm/data/charts/full/AAPL_20170626_20171003_390.png new file mode 100644 index 0000000000000000000000000000000000000000..a05eb2f13369e37ab1cdfab662d318701150e723 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170626_20171003_390.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170711_20171017_400.png b/fin-mm/data/charts/full/AAPL_20170711_20171017_400.png new file mode 100644 index 0000000000000000000000000000000000000000..21db920c4ca6942db41d2a451beec4a20ae11e0d Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170711_20171017_400.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170725_20171031_410.png b/fin-mm/data/charts/full/AAPL_20170725_20171031_410.png new file mode 100644 index 0000000000000000000000000000000000000000..5b6159ce7da039a4cf1690f5f46152b89c3373ff Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170725_20171031_410.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170808_20171114_420.png b/fin-mm/data/charts/full/AAPL_20170808_20171114_420.png new file mode 100644 index 0000000000000000000000000000000000000000..791e9cca76350eb280743144c9b0d3007990836c Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170808_20171114_420.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170822_20171129_430.png b/fin-mm/data/charts/full/AAPL_20170822_20171129_430.png new file mode 100644 index 0000000000000000000000000000000000000000..8e7be12510e7a395c1647e309f263929de9c414a Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170822_20171129_430.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170906_20171213_440.png b/fin-mm/data/charts/full/AAPL_20170906_20171213_440.png new file mode 100644 index 0000000000000000000000000000000000000000..23a2101b8021b7fd85ae6c3722877b980370a6cb Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170906_20171213_440.png differ diff --git a/fin-mm/data/charts/full/AAPL_20170920_20171228_450.png b/fin-mm/data/charts/full/AAPL_20170920_20171228_450.png new file mode 100644 index 0000000000000000000000000000000000000000..8f5426fa2f7f096d4aa804791bf2d716ec39bcbe Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20170920_20171228_450.png differ diff --git a/fin-mm/data/charts/full/AAPL_20171004_20180112_460.png b/fin-mm/data/charts/full/AAPL_20171004_20180112_460.png new file mode 100644 index 0000000000000000000000000000000000000000..5c48987775cb5ecd67aca6364ca8c8c921e22826 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20171004_20180112_460.png differ diff --git a/fin-mm/data/charts/full/AAPL_20171018_20180129_470.png b/fin-mm/data/charts/full/AAPL_20171018_20180129_470.png new file mode 100644 index 0000000000000000000000000000000000000000..cc62c4c8ea8f7cdf5c0e5b4ce5c7f377b645c5e7 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20171018_20180129_470.png differ diff --git a/fin-mm/data/charts/full/AAPL_20171101_20180212_480.png b/fin-mm/data/charts/full/AAPL_20171101_20180212_480.png new file mode 100644 index 0000000000000000000000000000000000000000..0a8eb0b29faa48368728bfe1d5134c30c85d1247 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20171101_20180212_480.png differ diff --git a/fin-mm/data/charts/full/AAPL_20171115_20180227_490.png b/fin-mm/data/charts/full/AAPL_20171115_20180227_490.png new file mode 100644 index 0000000000000000000000000000000000000000..68b13d58646e86190bf26ee78a1b5d054bb5f6fd Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20171115_20180227_490.png differ diff --git a/fin-mm/data/charts/full/AAPL_20171130_20180313_500.png b/fin-mm/data/charts/full/AAPL_20171130_20180313_500.png new file mode 100644 index 0000000000000000000000000000000000000000..b9c9accb3ad6c67e35f261b2eb2c1b8f5cccd8db Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20171130_20180313_500.png differ diff --git a/fin-mm/data/charts/full/AAPL_20171214_20180327_510.png b/fin-mm/data/charts/full/AAPL_20171214_20180327_510.png new file mode 100644 index 0000000000000000000000000000000000000000..bb86b8d41dfa3ad6dd0bfebe46856525c637d348 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20171214_20180327_510.png differ diff --git a/fin-mm/data/charts/full/AAPL_20171229_20180411_520.png b/fin-mm/data/charts/full/AAPL_20171229_20180411_520.png new file mode 100644 index 0000000000000000000000000000000000000000..48a18bd88a695746a806cfea5fde57a07a8e7533 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20171229_20180411_520.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180116_20180425_530.png b/fin-mm/data/charts/full/AAPL_20180116_20180425_530.png new file mode 100644 index 0000000000000000000000000000000000000000..3b58ce644eb5c8ccb3d8fd1a9d083528d845b769 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180116_20180425_530.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180130_20180509_540.png b/fin-mm/data/charts/full/AAPL_20180130_20180509_540.png new file mode 100644 index 0000000000000000000000000000000000000000..b4d67661f2f951bf6d73a5a7673ffb3c83576ae5 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180130_20180509_540.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180213_20180523_550.png b/fin-mm/data/charts/full/AAPL_20180213_20180523_550.png new file mode 100644 index 0000000000000000000000000000000000000000..a7752f47ba873b583985f7d42473a354060d107c Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180213_20180523_550.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180228_20180607_560.png b/fin-mm/data/charts/full/AAPL_20180228_20180607_560.png new file mode 100644 index 0000000000000000000000000000000000000000..6bc0aefacdbcfe71f6a5185d0af00a05c91091c4 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180228_20180607_560.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180314_20180621_570.png b/fin-mm/data/charts/full/AAPL_20180314_20180621_570.png new file mode 100644 index 0000000000000000000000000000000000000000..c1c39e01a880bb464ae8de541f3af97d8498b1f4 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180314_20180621_570.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180328_20180706_580.png b/fin-mm/data/charts/full/AAPL_20180328_20180706_580.png new file mode 100644 index 0000000000000000000000000000000000000000..52c7a1ccfef9798b834b16198010969686e28404 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180328_20180706_580.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180412_20180720_590.png b/fin-mm/data/charts/full/AAPL_20180412_20180720_590.png new file mode 100644 index 0000000000000000000000000000000000000000..61a7e2c951eeb587a64d980d5b027bf007fce140 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180412_20180720_590.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180426_20180803_600.png b/fin-mm/data/charts/full/AAPL_20180426_20180803_600.png new file mode 100644 index 0000000000000000000000000000000000000000..c1fb8fcd651905c96efda09155e95ac7ad9f7242 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180426_20180803_600.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180510_20180817_610.png b/fin-mm/data/charts/full/AAPL_20180510_20180817_610.png new file mode 100644 index 0000000000000000000000000000000000000000..23bf49b9352885a2cb2c72af565403d1d28b70b2 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180510_20180817_610.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180524_20180831_620.png b/fin-mm/data/charts/full/AAPL_20180524_20180831_620.png new file mode 100644 index 0000000000000000000000000000000000000000..ea5e30342a10da5e1beb21ef28f6c63f7a97e667 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180524_20180831_620.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180608_20180917_630.png b/fin-mm/data/charts/full/AAPL_20180608_20180917_630.png new file mode 100644 index 0000000000000000000000000000000000000000..2d916c870ed622fc0f98bef5fc625349827f89a8 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180608_20180917_630.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180622_20181001_640.png b/fin-mm/data/charts/full/AAPL_20180622_20181001_640.png new file mode 100644 index 0000000000000000000000000000000000000000..110b39bc1a1fac05fc47611e29635e8e16ccfa28 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180622_20181001_640.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180709_20181015_650.png b/fin-mm/data/charts/full/AAPL_20180709_20181015_650.png new file mode 100644 index 0000000000000000000000000000000000000000..10f4987a1e40dd8cad7a279114fb67420002b8e2 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180709_20181015_650.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180723_20181029_660.png b/fin-mm/data/charts/full/AAPL_20180723_20181029_660.png new file mode 100644 index 0000000000000000000000000000000000000000..7a6a43372fbfbadbb092b103263c678290f3cc79 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180723_20181029_660.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180806_20181112_670.png b/fin-mm/data/charts/full/AAPL_20180806_20181112_670.png new file mode 100644 index 0000000000000000000000000000000000000000..458890d7c55a051728a3b3d0ccb862d092d4440e Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180806_20181112_670.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180820_20181127_680.png b/fin-mm/data/charts/full/AAPL_20180820_20181127_680.png new file mode 100644 index 0000000000000000000000000000000000000000..c5beee29412598d5d0556444a4ee03ff8bb68f75 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180820_20181127_680.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180904_20181212_690.png b/fin-mm/data/charts/full/AAPL_20180904_20181212_690.png new file mode 100644 index 0000000000000000000000000000000000000000..04fa0a913989b12c841c18bee8c23f16835764e2 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180904_20181212_690.png differ diff --git a/fin-mm/data/charts/full/AAPL_20180918_20181227_700.png b/fin-mm/data/charts/full/AAPL_20180918_20181227_700.png new file mode 100644 index 0000000000000000000000000000000000000000..14f7d7169190558b4c69dc831dedbc62e7b5bab5 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20180918_20181227_700.png differ diff --git a/fin-mm/data/charts/full/AAPL_20181002_20190111_710.png b/fin-mm/data/charts/full/AAPL_20181002_20190111_710.png new file mode 100644 index 0000000000000000000000000000000000000000..342b8aae05ecae2a6ea92e671a19739eb6b1a7c1 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20181002_20190111_710.png differ diff --git a/fin-mm/data/charts/full/AAPL_20181016_20190128_720.png b/fin-mm/data/charts/full/AAPL_20181016_20190128_720.png new file mode 100644 index 0000000000000000000000000000000000000000..a27a79e951ab7a6cdf17c27fa153a22a2307bce2 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20181016_20190128_720.png differ diff --git a/fin-mm/data/charts/full/AAPL_20181030_20190211_730.png b/fin-mm/data/charts/full/AAPL_20181030_20190211_730.png new file mode 100644 index 0000000000000000000000000000000000000000..b541a5275abd4b868d174c927ffae8c86f45dcd7 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20181030_20190211_730.png differ diff --git a/fin-mm/data/charts/full/AAPL_20181113_20190226_740.png b/fin-mm/data/charts/full/AAPL_20181113_20190226_740.png new file mode 100644 index 0000000000000000000000000000000000000000..681916c3858c22c93107698e0b87ba7c3603f374 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20181113_20190226_740.png differ diff --git a/fin-mm/data/charts/full/AAPL_20181128_20190312_750.png b/fin-mm/data/charts/full/AAPL_20181128_20190312_750.png new file mode 100644 index 0000000000000000000000000000000000000000..3457d33efa5066f68677e50cc54f58ead44d06a0 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20181128_20190312_750.png differ diff --git a/fin-mm/data/charts/full/AAPL_20181213_20190326_760.png b/fin-mm/data/charts/full/AAPL_20181213_20190326_760.png new file mode 100644 index 0000000000000000000000000000000000000000..f5fed52fd77575647f576ae0114696bbac945703 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20181213_20190326_760.png differ diff --git a/fin-mm/data/charts/full/AAPL_20181228_20190409_770.png b/fin-mm/data/charts/full/AAPL_20181228_20190409_770.png new file mode 100644 index 0000000000000000000000000000000000000000..06a362203d104a028d519f05cbde972ab690a5a4 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20181228_20190409_770.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190114_20190424_780.png b/fin-mm/data/charts/full/AAPL_20190114_20190424_780.png new file mode 100644 index 0000000000000000000000000000000000000000..0e4bfadc1f620e2a150bcb4ca0080633256d87fe Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190114_20190424_780.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190129_20190508_790.png b/fin-mm/data/charts/full/AAPL_20190129_20190508_790.png new file mode 100644 index 0000000000000000000000000000000000000000..a423f46fd4f03fd6bd831cf4c9514bc83cfc1e92 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190129_20190508_790.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190212_20190522_800.png b/fin-mm/data/charts/full/AAPL_20190212_20190522_800.png new file mode 100644 index 0000000000000000000000000000000000000000..2620d298035744349235d500c93826a2be4603d2 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190212_20190522_800.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190227_20190606_810.png b/fin-mm/data/charts/full/AAPL_20190227_20190606_810.png new file mode 100644 index 0000000000000000000000000000000000000000..ee19de67159be7708a299f836d039b86032e87e1 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190227_20190606_810.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190313_20190620_820.png b/fin-mm/data/charts/full/AAPL_20190313_20190620_820.png new file mode 100644 index 0000000000000000000000000000000000000000..2ba6107b93ecb66edbc29b5f63c7bd893f11a7dc Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190313_20190620_820.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190327_20190705_830.png b/fin-mm/data/charts/full/AAPL_20190327_20190705_830.png new file mode 100644 index 0000000000000000000000000000000000000000..e6580df97678edd095545f83d8e8e06d596d17a9 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190327_20190705_830.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190410_20190719_840.png b/fin-mm/data/charts/full/AAPL_20190410_20190719_840.png new file mode 100644 index 0000000000000000000000000000000000000000..3f5a6f4ab4c1de9943bf23a9a50b0fab80b6d327 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190410_20190719_840.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190425_20190802_850.png b/fin-mm/data/charts/full/AAPL_20190425_20190802_850.png new file mode 100644 index 0000000000000000000000000000000000000000..d9e8e5081bcc0e0fa580fff5b48042fba8343cfa Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190425_20190802_850.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190509_20190816_860.png b/fin-mm/data/charts/full/AAPL_20190509_20190816_860.png new file mode 100644 index 0000000000000000000000000000000000000000..541067298c25323d258dc6d36986c40c6c7accc3 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190509_20190816_860.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190523_20190830_870.png b/fin-mm/data/charts/full/AAPL_20190523_20190830_870.png new file mode 100644 index 0000000000000000000000000000000000000000..b92467343113db14baabc8539a3e60a5c234e69c Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190523_20190830_870.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190607_20190916_880.png b/fin-mm/data/charts/full/AAPL_20190607_20190916_880.png new file mode 100644 index 0000000000000000000000000000000000000000..8ed332eb67b5861f793c93420897670100b922d7 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190607_20190916_880.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190621_20190930_890.png b/fin-mm/data/charts/full/AAPL_20190621_20190930_890.png new file mode 100644 index 0000000000000000000000000000000000000000..f333310c45e676013d7ee9d5de0ff63fda3900af Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190621_20190930_890.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190708_20191014_900.png b/fin-mm/data/charts/full/AAPL_20190708_20191014_900.png new file mode 100644 index 0000000000000000000000000000000000000000..64d19209ccd833eb678602cf88dd744b29b4141b Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190708_20191014_900.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190722_20191028_910.png b/fin-mm/data/charts/full/AAPL_20190722_20191028_910.png new file mode 100644 index 0000000000000000000000000000000000000000..dfffe821a01410172388332bd43bd117d4f14a03 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190722_20191028_910.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190805_20191111_920.png b/fin-mm/data/charts/full/AAPL_20190805_20191111_920.png new file mode 100644 index 0000000000000000000000000000000000000000..2328e8c6846a01d214bb8d17c1f89eb550e7a5b3 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190805_20191111_920.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190819_20191125_930.png b/fin-mm/data/charts/full/AAPL_20190819_20191125_930.png new file mode 100644 index 0000000000000000000000000000000000000000..3fc57b9087dd1f7a39d11dffd4e32829edaaa892 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190819_20191125_930.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190903_20191210_940.png b/fin-mm/data/charts/full/AAPL_20190903_20191210_940.png new file mode 100644 index 0000000000000000000000000000000000000000..9be0bcbe6180d950c14a94a4d5ae020cf7e077d7 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190903_20191210_940.png differ diff --git a/fin-mm/data/charts/full/AAPL_20190917_20191224_950.png b/fin-mm/data/charts/full/AAPL_20190917_20191224_950.png new file mode 100644 index 0000000000000000000000000000000000000000..99801291f2512353ab932ff24f447751ab3c1ffb Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20190917_20191224_950.png differ diff --git a/fin-mm/data/charts/full/AAPL_20191001_20200109_960.png b/fin-mm/data/charts/full/AAPL_20191001_20200109_960.png new file mode 100644 index 0000000000000000000000000000000000000000..8f49b61ac8d22424969d7d3e3d3d4eacbb62ce22 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20191001_20200109_960.png differ diff --git a/fin-mm/data/charts/full/AAPL_20191015_20200124_970.png b/fin-mm/data/charts/full/AAPL_20191015_20200124_970.png new file mode 100644 index 0000000000000000000000000000000000000000..b9e30b7c7efff6ba37dcd4e64cdaf898c635024b Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20191015_20200124_970.png differ diff --git a/fin-mm/data/charts/full/AAPL_20191029_20200207_980.png b/fin-mm/data/charts/full/AAPL_20191029_20200207_980.png new file mode 100644 index 0000000000000000000000000000000000000000..39362e9013ae14e4b7ea23715a9294875685a03a Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20191029_20200207_980.png differ diff --git a/fin-mm/data/charts/full/AAPL_20191112_20200224_990.png b/fin-mm/data/charts/full/AAPL_20191112_20200224_990.png new file mode 100644 index 0000000000000000000000000000000000000000..8213ef2580d446484d1c3f72d06fcd721e08ccf3 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20191112_20200224_990.png differ diff --git a/fin-mm/data/charts/full/AAPL_20191126_20200309_1000.png b/fin-mm/data/charts/full/AAPL_20191126_20200309_1000.png new file mode 100644 index 0000000000000000000000000000000000000000..2bdd676e4fec6969e20570795cd790b3dee6f5c3 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20191126_20200309_1000.png differ diff --git a/fin-mm/data/charts/full/AAPL_20191211_20200323_1010.png b/fin-mm/data/charts/full/AAPL_20191211_20200323_1010.png new file mode 100644 index 0000000000000000000000000000000000000000..11c9f80251f3fce04fbef1b8604202643f9626be Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20191211_20200323_1010.png differ diff --git a/fin-mm/data/charts/full/AAPL_20191226_20200406_1020.png b/fin-mm/data/charts/full/AAPL_20191226_20200406_1020.png new file mode 100644 index 0000000000000000000000000000000000000000..e18a23f169b1c41657f911936b0f01717965286c Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20191226_20200406_1020.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200110_20200421_1030.png b/fin-mm/data/charts/full/AAPL_20200110_20200421_1030.png new file mode 100644 index 0000000000000000000000000000000000000000..e67e611cd6f8d18431bfb68e77c8157f187e1850 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200110_20200421_1030.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200127_20200505_1040.png b/fin-mm/data/charts/full/AAPL_20200127_20200505_1040.png new file mode 100644 index 0000000000000000000000000000000000000000..84354aef252bd36edab3927bd84373db9a0a653c Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200127_20200505_1040.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200210_20200519_1050.png b/fin-mm/data/charts/full/AAPL_20200210_20200519_1050.png new file mode 100644 index 0000000000000000000000000000000000000000..5e6b3c303e286af299b1e094a9391138658e2954 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200210_20200519_1050.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200225_20200603_1060.png b/fin-mm/data/charts/full/AAPL_20200225_20200603_1060.png new file mode 100644 index 0000000000000000000000000000000000000000..361580a29c0e13f77696ae10b49b19d454c5623a Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200225_20200603_1060.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200310_20200617_1070.png b/fin-mm/data/charts/full/AAPL_20200310_20200617_1070.png new file mode 100644 index 0000000000000000000000000000000000000000..3a5cf3bd54b4a00a572c847f4bf1878e38c00885 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200310_20200617_1070.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200324_20200701_1080.png b/fin-mm/data/charts/full/AAPL_20200324_20200701_1080.png new file mode 100644 index 0000000000000000000000000000000000000000..c88e4e92057f8e40ea2e9c40daa52bb65837d2ba Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200324_20200701_1080.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200407_20200716_1090.png b/fin-mm/data/charts/full/AAPL_20200407_20200716_1090.png new file mode 100644 index 0000000000000000000000000000000000000000..7fa26d8b3fe9f075530c5688847d97b900cdf22e Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200407_20200716_1090.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200422_20200730_1100.png b/fin-mm/data/charts/full/AAPL_20200422_20200730_1100.png new file mode 100644 index 0000000000000000000000000000000000000000..66b04f21c8005bf9df06867d49afc3eab96a9bb1 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200422_20200730_1100.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200506_20200813_1110.png b/fin-mm/data/charts/full/AAPL_20200506_20200813_1110.png new file mode 100644 index 0000000000000000000000000000000000000000..ab25dd7e3c253153cf708fe73b4ae1528cb41036 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200506_20200813_1110.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200520_20200827_1120.png b/fin-mm/data/charts/full/AAPL_20200520_20200827_1120.png new file mode 100644 index 0000000000000000000000000000000000000000..6a1a8419f2e49bc1d964e08870e3d8bcb8e4b60f Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200520_20200827_1120.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200604_20200911_1130.png b/fin-mm/data/charts/full/AAPL_20200604_20200911_1130.png new file mode 100644 index 0000000000000000000000000000000000000000..aef08199403a873490bd481738acc5257c3373b0 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200604_20200911_1130.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200618_20200925_1140.png b/fin-mm/data/charts/full/AAPL_20200618_20200925_1140.png new file mode 100644 index 0000000000000000000000000000000000000000..c86bdc0acf3d40f1e6c29b3401d73143e68e35e3 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200618_20200925_1140.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200702_20201009_1150.png b/fin-mm/data/charts/full/AAPL_20200702_20201009_1150.png new file mode 100644 index 0000000000000000000000000000000000000000..fa08587c941b35d5245b71ebc8ed9035f9c02a7d Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200702_20201009_1150.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200717_20201023_1160.png b/fin-mm/data/charts/full/AAPL_20200717_20201023_1160.png new file mode 100644 index 0000000000000000000000000000000000000000..09bdadaae0f92300595c942f0e92b1242283ee03 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200717_20201023_1160.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200731_20201106_1170.png b/fin-mm/data/charts/full/AAPL_20200731_20201106_1170.png new file mode 100644 index 0000000000000000000000000000000000000000..ca1915588d04d548720798f79de408fe005864f9 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200731_20201106_1170.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200814_20201120_1180.png b/fin-mm/data/charts/full/AAPL_20200814_20201120_1180.png new file mode 100644 index 0000000000000000000000000000000000000000..96e794c9afc4b2470b1267947bea3ceb065378b2 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200814_20201120_1180.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200828_20201207_1190.png b/fin-mm/data/charts/full/AAPL_20200828_20201207_1190.png new file mode 100644 index 0000000000000000000000000000000000000000..94ce105f6cce507c2478d0bce7700006e33fd728 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200828_20201207_1190.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200914_20201221_1200.png b/fin-mm/data/charts/full/AAPL_20200914_20201221_1200.png new file mode 100644 index 0000000000000000000000000000000000000000..da4b50e4b2f3d7816215f25772154c04b7d04067 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200914_20201221_1200.png differ diff --git a/fin-mm/data/charts/full/AAPL_20200928_20210106_1210.png b/fin-mm/data/charts/full/AAPL_20200928_20210106_1210.png new file mode 100644 index 0000000000000000000000000000000000000000..ad5e59ee130a8d04c5cb15bf18feffdf7c2be80f Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20200928_20210106_1210.png differ diff --git a/fin-mm/data/charts/full/AAPL_20201012_20210121_1220.png b/fin-mm/data/charts/full/AAPL_20201012_20210121_1220.png new file mode 100644 index 0000000000000000000000000000000000000000..543413efdad4f832c6a7101cc416b679d71f2bd4 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20201012_20210121_1220.png differ diff --git a/fin-mm/data/charts/full/AAPL_20201026_20210204_1230.png b/fin-mm/data/charts/full/AAPL_20201026_20210204_1230.png new file mode 100644 index 0000000000000000000000000000000000000000..176c70f4de67f23781be493265fffc4e69c28b8b Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20201026_20210204_1230.png differ diff --git a/fin-mm/data/charts/full/AAPL_20201109_20210219_1240.png b/fin-mm/data/charts/full/AAPL_20201109_20210219_1240.png new file mode 100644 index 0000000000000000000000000000000000000000..a424fa5cfdf4d78c524a547b1410fd4a5c69b0e2 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20201109_20210219_1240.png differ diff --git a/fin-mm/data/charts/full/AAPL_20201123_20210305_1250.png b/fin-mm/data/charts/full/AAPL_20201123_20210305_1250.png new file mode 100644 index 0000000000000000000000000000000000000000..bb8c3ce7859c4116f1747423039177a819ccf75d Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20201123_20210305_1250.png differ diff --git a/fin-mm/data/charts/full/AAPL_20201208_20210319_1260.png b/fin-mm/data/charts/full/AAPL_20201208_20210319_1260.png new file mode 100644 index 0000000000000000000000000000000000000000..a4b9e8f2a6dc6ed5bff1cc903aeee18162199598 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20201208_20210319_1260.png differ diff --git a/fin-mm/data/charts/full/AAPL_20201222_20210405_1270.png b/fin-mm/data/charts/full/AAPL_20201222_20210405_1270.png new file mode 100644 index 0000000000000000000000000000000000000000..4fc4e9fd13a09ce076d945f4c115875f76a4938b Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20201222_20210405_1270.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210107_20210419_1280.png b/fin-mm/data/charts/full/AAPL_20210107_20210419_1280.png new file mode 100644 index 0000000000000000000000000000000000000000..b32f182cef2e51c72ac481eaf69c27abb3a5a319 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210107_20210419_1280.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210122_20210503_1290.png b/fin-mm/data/charts/full/AAPL_20210122_20210503_1290.png new file mode 100644 index 0000000000000000000000000000000000000000..aa36ffd6b6139e1f9025889cb6f5126fb0915fae Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210122_20210503_1290.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210205_20210517_1300.png b/fin-mm/data/charts/full/AAPL_20210205_20210517_1300.png new file mode 100644 index 0000000000000000000000000000000000000000..3cd950e07d99797f9902469c768fbadc58b6b01a Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210205_20210517_1300.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210222_20210601_1310.png b/fin-mm/data/charts/full/AAPL_20210222_20210601_1310.png new file mode 100644 index 0000000000000000000000000000000000000000..e3b2be68471591b6a30c8454866bfba43fd342b3 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210222_20210601_1310.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210308_20210615_1320.png b/fin-mm/data/charts/full/AAPL_20210308_20210615_1320.png new file mode 100644 index 0000000000000000000000000000000000000000..4cd205bdc17f2622135e9b407a969211829d003e Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210308_20210615_1320.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210322_20210629_1330.png b/fin-mm/data/charts/full/AAPL_20210322_20210629_1330.png new file mode 100644 index 0000000000000000000000000000000000000000..fbf934cf37acb18eb4fb4a3c96af1472c1755b99 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210322_20210629_1330.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210406_20210714_1340.png b/fin-mm/data/charts/full/AAPL_20210406_20210714_1340.png new file mode 100644 index 0000000000000000000000000000000000000000..b683cb70115abfed9609853191b3978d1cce5f84 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210406_20210714_1340.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210420_20210728_1350.png b/fin-mm/data/charts/full/AAPL_20210420_20210728_1350.png new file mode 100644 index 0000000000000000000000000000000000000000..f3c2764844fdbb8e0888151bd65e32ad19145d98 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210420_20210728_1350.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210504_20210811_1360.png b/fin-mm/data/charts/full/AAPL_20210504_20210811_1360.png new file mode 100644 index 0000000000000000000000000000000000000000..95cb5703d1055cc8ad38750926e6aab12eaa2929 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210504_20210811_1360.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210518_20210825_1370.png b/fin-mm/data/charts/full/AAPL_20210518_20210825_1370.png new file mode 100644 index 0000000000000000000000000000000000000000..1619c10fcb6127f0aee1cd103a9532728d04b5d2 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210518_20210825_1370.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210602_20210909_1380.png b/fin-mm/data/charts/full/AAPL_20210602_20210909_1380.png new file mode 100644 index 0000000000000000000000000000000000000000..ff14b7da0ec5249c1887fa53d427a633804427c1 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210602_20210909_1380.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210616_20210923_1390.png b/fin-mm/data/charts/full/AAPL_20210616_20210923_1390.png new file mode 100644 index 0000000000000000000000000000000000000000..1b56ac61df6009bf5cd91f40e914ab5d3c1653a1 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210616_20210923_1390.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210630_20211007_1400.png b/fin-mm/data/charts/full/AAPL_20210630_20211007_1400.png new file mode 100644 index 0000000000000000000000000000000000000000..dbf57346f2a0fd60e45e8a245ee926ab4f0a0260 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210630_20211007_1400.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210715_20211021_1410.png b/fin-mm/data/charts/full/AAPL_20210715_20211021_1410.png new file mode 100644 index 0000000000000000000000000000000000000000..76dbf69bc3143cba6df8c8de6be3abac6a904559 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210715_20211021_1410.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210729_20211104_1420.png b/fin-mm/data/charts/full/AAPL_20210729_20211104_1420.png new file mode 100644 index 0000000000000000000000000000000000000000..b1fa9ce6f8814249da6e49cdff58c9fc0c18e08c Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210729_20211104_1420.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210812_20211118_1430.png b/fin-mm/data/charts/full/AAPL_20210812_20211118_1430.png new file mode 100644 index 0000000000000000000000000000000000000000..33c7e5781eb5351f1e132ec0bac353451be03269 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210812_20211118_1430.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210826_20211203_1440.png b/fin-mm/data/charts/full/AAPL_20210826_20211203_1440.png new file mode 100644 index 0000000000000000000000000000000000000000..410081bcd20b90d19f7759bf5ca04335d6d605fa Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210826_20211203_1440.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210910_20211217_1450.png b/fin-mm/data/charts/full/AAPL_20210910_20211217_1450.png new file mode 100644 index 0000000000000000000000000000000000000000..9382f0af94eba82289beff7137fa6f4913b4f96b Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210910_20211217_1450.png differ diff --git a/fin-mm/data/charts/full/AAPL_20210924_20220103_1460.png b/fin-mm/data/charts/full/AAPL_20210924_20220103_1460.png new file mode 100644 index 0000000000000000000000000000000000000000..3961783b69ceac95b629331180490106352af627 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20210924_20220103_1460.png differ diff --git a/fin-mm/data/charts/full/AAPL_20211008_20220118_1470.png b/fin-mm/data/charts/full/AAPL_20211008_20220118_1470.png new file mode 100644 index 0000000000000000000000000000000000000000..1cab56333dbbac9ee1be7f4947bf35c5db954727 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20211008_20220118_1470.png differ diff --git a/fin-mm/data/charts/full/AAPL_20211022_20220201_1480.png b/fin-mm/data/charts/full/AAPL_20211022_20220201_1480.png new file mode 100644 index 0000000000000000000000000000000000000000..4ea4124652bef85c8d9bce74ed2fc0c2a479338c Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20211022_20220201_1480.png differ diff --git a/fin-mm/data/charts/full/AAPL_20211105_20220215_1490.png b/fin-mm/data/charts/full/AAPL_20211105_20220215_1490.png new file mode 100644 index 0000000000000000000000000000000000000000..1974f2bc17816211d2a250c509884f016a302002 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20211105_20220215_1490.png differ diff --git a/fin-mm/data/charts/full/AAPL_20211119_20220302_1500.png b/fin-mm/data/charts/full/AAPL_20211119_20220302_1500.png new file mode 100644 index 0000000000000000000000000000000000000000..1561781a26e1e625dacaf0745098b4beb82cf830 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20211119_20220302_1500.png differ diff --git a/fin-mm/data/charts/full/AAPL_20211206_20220316_1510.png b/fin-mm/data/charts/full/AAPL_20211206_20220316_1510.png new file mode 100644 index 0000000000000000000000000000000000000000..6b60fe6ba3dd56c6085a329cc1d4af9e8b483d8c Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20211206_20220316_1510.png differ diff --git a/fin-mm/data/charts/full/AAPL_20211220_20220330_1520.png b/fin-mm/data/charts/full/AAPL_20211220_20220330_1520.png new file mode 100644 index 0000000000000000000000000000000000000000..c37f561b4a4440cbadad769b3aa67b210273e21c Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20211220_20220330_1520.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220104_20220413_1530.png b/fin-mm/data/charts/full/AAPL_20220104_20220413_1530.png new file mode 100644 index 0000000000000000000000000000000000000000..3eda2a515fdf4372c3a0689e30c47caf0831cee9 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220104_20220413_1530.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220119_20220428_1540.png b/fin-mm/data/charts/full/AAPL_20220119_20220428_1540.png new file mode 100644 index 0000000000000000000000000000000000000000..f2fb1d9919b675e826cb091a2da3a6166e56b5b7 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220119_20220428_1540.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220202_20220512_1550.png b/fin-mm/data/charts/full/AAPL_20220202_20220512_1550.png new file mode 100644 index 0000000000000000000000000000000000000000..a8440c2f9fd3fca30f28da481422fcf8a20d236f Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220202_20220512_1550.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220216_20220526_1560.png b/fin-mm/data/charts/full/AAPL_20220216_20220526_1560.png new file mode 100644 index 0000000000000000000000000000000000000000..5c69ec8673dab4da6e80b4bee592f09ed9ba242b Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220216_20220526_1560.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220303_20220610_1570.png b/fin-mm/data/charts/full/AAPL_20220303_20220610_1570.png new file mode 100644 index 0000000000000000000000000000000000000000..ac86bf9bbbbe6dd1616f0d686e38526ce3f17317 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220303_20220610_1570.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220317_20220627_1580.png b/fin-mm/data/charts/full/AAPL_20220317_20220627_1580.png new file mode 100644 index 0000000000000000000000000000000000000000..dc187bbd97f11f727df33db9b30a0e0e371a74e1 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220317_20220627_1580.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220331_20220712_1590.png b/fin-mm/data/charts/full/AAPL_20220331_20220712_1590.png new file mode 100644 index 0000000000000000000000000000000000000000..c2b74ba9a23eede0d6df753d65968ce1c6a28981 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220331_20220712_1590.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220414_20220726_1600.png b/fin-mm/data/charts/full/AAPL_20220414_20220726_1600.png new file mode 100644 index 0000000000000000000000000000000000000000..8774db2b8210cb4d293a712382ed925421911daa Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220414_20220726_1600.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220429_20220809_1610.png b/fin-mm/data/charts/full/AAPL_20220429_20220809_1610.png new file mode 100644 index 0000000000000000000000000000000000000000..1082b25dafefc59f6600f5600c6f1071ded2c7d3 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220429_20220809_1610.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220513_20220823_1620.png b/fin-mm/data/charts/full/AAPL_20220513_20220823_1620.png new file mode 100644 index 0000000000000000000000000000000000000000..2eb5c52847f9227d7cdfa577638641b76459a24b Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220513_20220823_1620.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220527_20220907_1630.png b/fin-mm/data/charts/full/AAPL_20220527_20220907_1630.png new file mode 100644 index 0000000000000000000000000000000000000000..14c023acb72e0b0ba4c43dcaffbd50f0651939b0 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220527_20220907_1630.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220613_20220921_1640.png b/fin-mm/data/charts/full/AAPL_20220613_20220921_1640.png new file mode 100644 index 0000000000000000000000000000000000000000..08e300bcd1ed5b79cf69f29738685309594abf98 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220613_20220921_1640.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220628_20221005_1650.png b/fin-mm/data/charts/full/AAPL_20220628_20221005_1650.png new file mode 100644 index 0000000000000000000000000000000000000000..ca52aea6f9fa4903b6ee30b8add91fc8ce733c57 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220628_20221005_1650.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220713_20221019_1660.png b/fin-mm/data/charts/full/AAPL_20220713_20221019_1660.png new file mode 100644 index 0000000000000000000000000000000000000000..904e1c8a902843f54ecad7ac1065d744b7da3a14 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220713_20221019_1660.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220727_20221102_1670.png b/fin-mm/data/charts/full/AAPL_20220727_20221102_1670.png new file mode 100644 index 0000000000000000000000000000000000000000..453bd7c0cfc1d77eb8e7ab2a1fe2ec97aa3eec14 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220727_20221102_1670.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220810_20221116_1680.png b/fin-mm/data/charts/full/AAPL_20220810_20221116_1680.png new file mode 100644 index 0000000000000000000000000000000000000000..a3293e388df2c5e44e43cca1ac184c941457157d Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220810_20221116_1680.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220824_20221201_1690.png b/fin-mm/data/charts/full/AAPL_20220824_20221201_1690.png new file mode 100644 index 0000000000000000000000000000000000000000..9f7cb89b18f6c01a00b5edf2f7bcfe520756860c Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220824_20221201_1690.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220908_20221215_1700.png b/fin-mm/data/charts/full/AAPL_20220908_20221215_1700.png new file mode 100644 index 0000000000000000000000000000000000000000..6ad973d22add4735c958e3e68ecbe04607009b16 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220908_20221215_1700.png differ diff --git a/fin-mm/data/charts/full/AAPL_20220922_20221230_1710.png b/fin-mm/data/charts/full/AAPL_20220922_20221230_1710.png new file mode 100644 index 0000000000000000000000000000000000000000..6281f1b1a000e2f5d55fc03393157bf92ce2ee56 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20220922_20221230_1710.png differ diff --git a/fin-mm/data/charts/full/AAPL_20221006_20230117_1720.png b/fin-mm/data/charts/full/AAPL_20221006_20230117_1720.png new file mode 100644 index 0000000000000000000000000000000000000000..b66bce038f96df1d0cf12a95c677c5b94eac6d0b Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20221006_20230117_1720.png differ diff --git a/fin-mm/data/charts/full/AAPL_20221020_20230131_1730.png b/fin-mm/data/charts/full/AAPL_20221020_20230131_1730.png new file mode 100644 index 0000000000000000000000000000000000000000..6e2d00a2af751a6bf35a3441a031e463bcab7496 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20221020_20230131_1730.png differ diff --git a/fin-mm/data/charts/full/AAPL_20221103_20230214_1740.png b/fin-mm/data/charts/full/AAPL_20221103_20230214_1740.png new file mode 100644 index 0000000000000000000000000000000000000000..3ce9eb32c7bdfc1ff1f0966e7ee8bc516f649cb3 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20221103_20230214_1740.png differ diff --git a/fin-mm/data/charts/full/AAPL_20221117_20230301_1750.png b/fin-mm/data/charts/full/AAPL_20221117_20230301_1750.png new file mode 100644 index 0000000000000000000000000000000000000000..9126b0661370c186d232446e9cd75a5c6588a94e Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20221117_20230301_1750.png differ diff --git a/fin-mm/data/charts/full/AAPL_20221202_20230315_1760.png b/fin-mm/data/charts/full/AAPL_20221202_20230315_1760.png new file mode 100644 index 0000000000000000000000000000000000000000..58c09523d8e61abb2da211105c4e4f030d1a0774 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20221202_20230315_1760.png differ diff --git a/fin-mm/data/charts/full/AAPL_20221216_20230329_1770.png b/fin-mm/data/charts/full/AAPL_20221216_20230329_1770.png new file mode 100644 index 0000000000000000000000000000000000000000..ae6f635ef7b8c527aa17a4d3ab84395d8adeabb2 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20221216_20230329_1770.png differ diff --git a/fin-mm/data/charts/full/AAPL_20230103_20230413_1780.png b/fin-mm/data/charts/full/AAPL_20230103_20230413_1780.png new file mode 100644 index 0000000000000000000000000000000000000000..c9d01cbe3dbc309f285a831dcfa4e894ea34bb83 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20230103_20230413_1780.png differ diff --git a/fin-mm/data/charts/full/AAPL_20230118_20230427_1790.png b/fin-mm/data/charts/full/AAPL_20230118_20230427_1790.png new file mode 100644 index 0000000000000000000000000000000000000000..5499c73da3f52b6316ff3ee024384b3a8b279218 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20230118_20230427_1790.png differ diff --git a/fin-mm/data/charts/full/AAPL_20230201_20230511_1800.png b/fin-mm/data/charts/full/AAPL_20230201_20230511_1800.png new file mode 100644 index 0000000000000000000000000000000000000000..c37a0011dd59695790610830cecacf58df9a1312 Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20230201_20230511_1800.png differ diff --git a/fin-mm/data/charts/full/AAPL_20230215_20230525_1810.png b/fin-mm/data/charts/full/AAPL_20230215_20230525_1810.png new file mode 100644 index 0000000000000000000000000000000000000000..dff1d73b8fcc5a33da8cd9458a0360a36f21527e Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20230215_20230525_1810.png differ diff --git a/fin-mm/data/charts/full/AAPL_20230302_20230609_1820.png b/fin-mm/data/charts/full/AAPL_20230302_20230609_1820.png new file mode 100644 index 0000000000000000000000000000000000000000..a0abed6a70bdfa715f770dd2d83d46b161bf8bac Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20230302_20230609_1820.png differ diff --git a/fin-mm/data/charts/full/AAPL_20230316_20230626_1830.png b/fin-mm/data/charts/full/AAPL_20230316_20230626_1830.png new file mode 100644 index 0000000000000000000000000000000000000000..b106b9373756bc6311b14ff4e8dcf5be6d66da2f Binary files /dev/null and b/fin-mm/data/charts/full/AAPL_20230316_20230626_1830.png differ