openai/openai-python
Publicmirrored fromhttps://github.com/openai/openai-pythonAvailable
examples/generate_file.sh
10lines · modecode
| 1 | # generate a text file with random data for testing file uploads |
| 2 | wanted_size=$((1024*2048*512)) |
| 3 | file_size=$(( ((wanted_size/12)+1)*12 )) |
| 4 | read_size=$((file_size*3/4)) |
| 5 | |
| 6 | echo "wanted=$wanted_size file=$file_size read=$read_size" |
| 7 | |
| 8 | dd if=/dev/urandom bs=$read_size count=1 | base64 > /tmp/small_test_file.txt |
| 9 | |
| 10 | truncate -s "$wanted_size" /tmp/big_test_file.txt |
| 11 | |