-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on downloading model #15
Comments
Fixing it soon |
Simple fix.
def download_and_save():
url = 'https://gpt4all.io/models/ggml-gpt4all-j-v1.3-groovy.bin'
filename = 'ggml-gpt4all-j-v1.3-groovy.bin'
models_folder = 'models'
n_ctx = 1024 # Replace this with correct value
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
bytes_downloaded = 0
file_path = f'{models_folder}/{filename}'
if os.path.exists(file_path):
return jsonify(response="Download completed")
with open(file_path, 'wb') as file:
for chunk in response.iter_content(chunk_size=4096):
file.write(chunk)
bytes_downloaded += len(chunk)
progress = round((bytes_downloaded / total_size) * 100, 2)
print(f'Download Progress: {progress}%')
callbacks = [StreamingStdOutCallbackHandler()]
llm = GPT4All(model=file_path, n_ctx=n_ctx, backend='gptj', callbacks=callbacks, verbose=False)
return jsonify(response="Download completed") Then run |
Fixed now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Before downloading the model, create the models folder under server folder.
The text was updated successfully, but these errors were encountered: