-
-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
Hi,
in python ,download huggingface file ,we use requests like this,just set stream with true
import requests
fileUrl = "https://huggingface.co/codellama/CodeLlama-7b-Instruct-hf/resolve/main/config.json?download=true"
model_url = "https://huggingface.co/bert-base-uncased/resolve/main/pytorch_model.bin"
response = requests.get(fileUrl, stream=True)
with open("muller.json", "wb") as f:
for chunk in response.iter_content(chunk_size=8192):
f.write(chunk)
is equal in scala? I not find to set stream =true operation
requests.get.stream(…).readWithHeaders{ (headers, stream) =>
if (headers.statusCode == 200) {
os.write(..., stream)
} else {
println("Error. Not streaming file.")
}
}
Metadata
Metadata
Assignees
Labels
No labels