Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Using float32 on all archs for petals clients #110

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cht-petals/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e
export VERSION=1.0.1
export VERSION=1.0.2
source "$(dirname "${BASH_SOURCE[0]}")/../utils.sh"

build_cpu ghcr.io/premai-io/chat-stable-beluga-2-cpu petals-team/StableBeluga2 ${@:1}
Expand Down
9 changes: 3 additions & 6 deletions cht-petals/download.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import argparse
from platform import machine

import torch
from petals import AutoDistributedModelForCausalLM
Expand All @@ -17,11 +16,9 @@
def download_model() -> None:
Tokenizer = LlamaTokenizer if "llama" in args.model.lower() else AutoTokenizer
_ = Tokenizer.from_pretrained(args.model)

kwargs = {}
if "x86_64" in machine():
kwargs["torch_dtype"] = torch.float32
_ = AutoDistributedModelForCausalLM.from_pretrained(args.model, **kwargs)
_ = AutoDistributedModelForCausalLM.from_pretrained(
args.model, torch_dtype=torch.float32
)


download_model()
Loading