leoxing1996 commited on
Commit
63e4d9a
1 Parent(s): a519645

support queue and update notification

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -1
  2. demo/frontend/src/routes/+page.svelte +17 -14
Dockerfile CHANGED
@@ -36,7 +36,8 @@ ENV HOME=/home/user \
36
  PATH=/home/user/.local/bin:$PATH \
37
  PYTHONPATH=$HOME/app \
38
  PYTHONUNBUFFERED=1 \
39
- SYSTEM=spaces
 
40
 
41
  # Set the working directory to the user's home directory
42
  WORKDIR $HOME/app
 
36
  PATH=/home/user/.local/bin:$PATH \
37
  PYTHONPATH=$HOME/app \
38
  PYTHONUNBUFFERED=1 \
39
+ SYSTEM=spaces \
40
+ MAX_QUEUE_SIZE=2
41
 
42
  # Set the working directory to the user's home directory
43
  WORKDIR $HOME/app
demo/frontend/src/routes/+page.svelte CHANGED
@@ -6,7 +6,12 @@
6
  import Warning from '$lib/components/Warning.svelte';
7
  import Spinner from '$lib/icons/spinner.svelte';
8
  import { lcmLiveActions, lcmLiveStatus, LCMLiveStatus } from '$lib/lcmLive';
9
- import { mediaStreamActions, mediaStreamStatus, MediaStreamStatusEnum, onFrameChangeStore } from '$lib/mediaStream';
 
 
 
 
 
10
  import { deboucedPipelineValues, getPipelineValues } from '$lib/store';
11
  import type { Fields, PipelineInfo } from '$lib/types';
12
  import { PipelineMode } from '$lib/types';
@@ -66,12 +71,12 @@
66
  try {
67
  if (!isLCMRunning) {
68
  if (isImageMode) {
69
- if ($mediaStreamStatus === MediaStreamStatusEnum.DISCONNECTED) {
70
- warningMessage = 'Please allow camera access.';
71
- return
72
- }
73
- // await mediaStreamActions.enumerateDevices();
74
- // await mediaStreamActions.start();
75
  }
76
  disabled = true;
77
  await lcmLiveActions.start(getSreamdata);
@@ -82,12 +87,12 @@
82
  // mediaStreamActions.stop();
83
  // }
84
  lcmLiveActions.stop();
85
- mediaStreamActions.stop()
86
  toggleQueueChecker(true);
87
  }
88
  } catch (e) {
89
  warningMessage = e instanceof Error ? e.message : '';
90
- console.error(warningMessage)
91
  disabled = false;
92
  toggleQueueChecker(true);
93
  }
@@ -112,11 +117,9 @@
112
  <p class="text-sm">
113
  There are <span id="queue_size" class="font-bold">{currentQueueSize}</span>
114
  user(s) sharing the same GPU, affecting real-time performance. Maximum queue size is {maxQueueSize}.
115
- <a
116
- href="https://huggingface.co/spaces/radames/Real-Time-Latent-Consistency-Model?duplicate=true"
117
- target="_blank"
118
- class="text-blue-500 underline hover:no-underline">Duplicate</a
119
- > and run it on your own GPU.
120
  </p>
121
  {/if}
122
  </article>
 
6
  import Warning from '$lib/components/Warning.svelte';
7
  import Spinner from '$lib/icons/spinner.svelte';
8
  import { lcmLiveActions, lcmLiveStatus, LCMLiveStatus } from '$lib/lcmLive';
9
+ import {
10
+ mediaStreamActions,
11
+ mediaStreamStatus,
12
+ MediaStreamStatusEnum,
13
+ onFrameChangeStore
14
+ } from '$lib/mediaStream';
15
  import { deboucedPipelineValues, getPipelineValues } from '$lib/store';
16
  import type { Fields, PipelineInfo } from '$lib/types';
17
  import { PipelineMode } from '$lib/types';
 
71
  try {
72
  if (!isLCMRunning) {
73
  if (isImageMode) {
74
+ if ($mediaStreamStatus === MediaStreamStatusEnum.DISCONNECTED) {
75
+ warningMessage = 'Please allow camera access.';
76
+ return;
77
+ }
78
+ // await mediaStreamActions.enumerateDevices();
79
+ // await mediaStreamActions.start();
80
  }
81
  disabled = true;
82
  await lcmLiveActions.start(getSreamdata);
 
87
  // mediaStreamActions.stop();
88
  // }
89
  lcmLiveActions.stop();
90
+ mediaStreamActions.stop();
91
  toggleQueueChecker(true);
92
  }
93
  } catch (e) {
94
  warningMessage = e instanceof Error ? e.message : '';
95
+ console.error(warningMessage);
96
  disabled = false;
97
  toggleQueueChecker(true);
98
  }
 
117
  <p class="text-sm">
118
  There are <span id="queue_size" class="font-bold">{currentQueueSize}</span>
119
  user(s) sharing the same GPU, affecting real-time performance. Maximum queue size is {maxQueueSize}.
120
+ To avoid network latency and queuing, we strongly recommend cloning
121
+ <a href="https://github.com/open-mmlab/Live2Diff">our official repository</a> and running it
122
+ locally.
 
 
123
  </p>
124
  {/if}
125
  </article>