EtiennePerot / safe-code-execution

Code execution utilities for Open WebUI & Ollama
Apache License 2.0
194 stars 12 forks source link

Download large generated files #7

Closed lu4p closed 2 months ago

lu4p commented 2 months ago

I often use ChatGPT to generate or edit files. I think there is currently no way to output large files.

Example using ChatGPT

Prompt:

Generate a textfile with 1000 uuids

Answer:

I have generated a text file containing 1000 UUIDs. You can download it using the link below:

Download UUIDs file

Executed code:

import uuid

# Generate a list of 1000 UUIDs
uuid_list = [str(uuid.uuid4()) for _ in range(1000)]

# Save to a text file
file_path = '/mnt/data/uuids.txt'
with open(file_path, 'w') as f:
    for uid in uuid_list:
        f.write(uid + '\n')

file_path

EtiennePerot commented 2 months ago

In case anyone stumbles upon this issue later: This is a duplicate of issue #4, so follow that one instead.