Skip to content
Open
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
File renamed without changes.
13 changes: 5 additions & 8 deletions client/src/pages/Conversation/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,11 @@ const buildURL = ({
textSeed: number;
audioSeed: number;
}) => {
const newWorkerAddr = useMemo(() => {
if (workerAddr == "same" || workerAddr == "") {
const newWorkerAddr = window.location.hostname + ":" + window.location.port;
console.log("Overriding workerAddr to", newWorkerAddr);
return newWorkerAddr;
}
return workerAddr;
}, [workerAddr]);
let newWorkerAddr = workerAddr;
if (workerAddr === "same" || workerAddr === "") {
newWorkerAddr = window.location.hostname + ":" + window.location.port;
console.log("Overriding workerAddr to", newWorkerAddr);
}
const wsProtocol = (window.location.protocol === 'https:') ? 'wss' : 'ws';
const url = new URL(`${wsProtocol}://${newWorkerAddr}/api/chat`);
if(workerAuthId) {
Expand Down
7 changes: 1 addition & 6 deletions client/src/pages/Conversation/hooks/useSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ export const useSocket = ({

const onDisconnect = useCallback((event: CloseEvent) => {
const closedSocket = event.target as WebSocket;
console.log("disconnected");
setSocketStatus("disconnected");
if (onDisconnectProp) {
onDisconnectProp();
}
// ONLY clear socketRef.current if it's the one that closed
// Only act on the current socket; ignore stale connections
if (socketRef.current === closedSocket) {
console.log("disconnected (current socket)");
socketRef.current = null;
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/Queue/Queue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const Queue:FC = () => {
if(env.VITE_ENV === "development") {
eruda.init();
}
() => {
return () => {
if(env.VITE_ENV === "development") {
eruda.destroy();
}
Expand Down
6 changes: 3 additions & 3 deletions moshi/moshi/models/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def get_moshi_lm(
for name, tensor in list(state_dict.items()):
if "depformer" in name and "self_attn" in name and name in model_sd:
if tensor.shape != model_sd[name].shape:
print("Expanding %s", name)
print(f"Expanding {name}")
missing = (
tensor
if copy_missing_weights
Expand All @@ -241,14 +241,14 @@ def get_moshi_lm(
if needle in name:
src = name.replace(needle, f"{rep}.{old}.")
if src in state_dict:
print("Replacing %s <- %s", name, src)
print(f"Replacing {name} <- {src}")
state_dict[name] = state_dict[src]
replaced = True
break
if replaced:
break
if not replaced:
print("Missing %s", name)
print(f"Missing {name}")

# Assign weights to target device
dev = torch.device(device) if isinstance(device, str) else device
Expand Down
4 changes: 3 additions & 1 deletion moshi/moshi/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ def main():

# Download config.json to increment download counter
# No worries about double-counting since config.json will be cached the second time
hf_hub_download(args.hf_repo, "config.json")
# Increment HF download counter (analytics only, skip in offline mode)
if not os.environ.get("HF_HUB_OFFLINE"):
hf_hub_download(args.hf_repo, "config.json")

logger.info("loading mimi")
if args.mimi_weight is None:
Expand Down
4 changes: 2 additions & 2 deletions moshi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies = [
"sentencepiece == 0.2",
"sounddevice == 0.5",
"sphn >= 0.1.4, < 0.2",
"torch >= 2.2.0, < 2.5",
"aiohttp>=3.10.5, <3.11",
"torch >= 2.2.0",
"aiohttp>=3.10.5",
]
authors = [{name="Rajarshi Roy", email="rajarshir@nvidia.com"}]
maintainers = [{name="Rajarshi Roy", email="rajarshir@nvidia.com"}]
Expand Down