mirror of
https://github.com/RYDE-WORK/ktransformers.git
synced 2026-02-08 07:49:27 +08:00
Merge pull request #684 from KMSorSMS/main
fix dockerfile in devcontainer and fix expert torch
This commit is contained in:
commit
e7ebb26370
@ -10,7 +10,6 @@ apt update -y && apt install -y --no-install-recommends \
|
|||||||
g++ \
|
g++ \
|
||||||
cmake &&
|
cmake &&
|
||||||
rm -rf /var/lib/apt/lists/* &&
|
rm -rf /var/lib/apt/lists/* &&
|
||||||
cd ktransformers &&
|
|
||||||
pip install ninja pyproject numpy cpufeature &&
|
pip install ninja pyproject numpy cpufeature &&
|
||||||
pip install flash-attn &&
|
pip install flash-attn &&
|
||||||
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /opt/conda/lib/
|
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /opt/conda/lib/
|
||||||
|
|||||||
@ -459,9 +459,9 @@ class KExpertsTorch(KExpertsBase):
|
|||||||
self.up[i] = w["up"][i, ...].to(device=device, dtype=self.dtype)
|
self.up[i] = w["up"][i, ...].to(device=device, dtype=self.dtype)
|
||||||
self.down[i] = w["down"][i, ...].to(device=device, dtype=self.dtype)
|
self.down[i] = w["down"][i, ...].to(device=device, dtype=self.dtype)
|
||||||
|
|
||||||
self.up = torch.cat(self.up, dim=0)
|
self.up = torch.stack(self.up, dim=0)
|
||||||
self.gate = torch.cat(self.gate, dim=0)
|
self.gate = torch.stack(self.gate, dim=0)
|
||||||
self.down = torch.cat(self.down, dim=0)
|
self.down = torch.stack(self.down, dim=0)
|
||||||
return
|
return
|
||||||
|
|
||||||
def unload(self):
|
def unload(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user