7. Let $p(p>2)$ be a prime number, and the set $A=\{1,2$, $\cdots, p-1\}$. If a non-empty subset $B \subseteq A$ is such that $p$ divides the sum of the elements in set $B$, then the number of subsets $B$ that satisfy this condition is $\qquad$ .
7. $\frac{2^{p-1}-1}{p}$.
$$
\text { Let } A_{1}=A \cup\{0\} \text {. }
$$

Let $B=\left\{a_{1}, a_{2}, \cdots, a_{k}\right\}$ be a non-empty subset of $A_{1}$, and $B_{i}=\left\{b_{i 1}, b_{i 2}, \cdots, b_{i k}\right\}(i=0,1, \cdots, p-1)$, where $b_{i j} \equiv i+a_{j}(\bmod p)(j=1, \cdots, k)$. Then the sums of all elements in the sets $B_{i}(i=0,1,2, \cdots, p-1)$ are distinct modulo $p$, forming a complete residue system modulo $p$. If not, there exist $s$ and $t$ such that the sums of elements in $B_{s}$ and $B_{t}$ are congruent modulo $p$, then
$$
\begin{array}{l}
\sum_{i=1}^{k}\left(s+a_{i}\right) \equiv \sum_{i=1}^{k}\left(t+a_{i}\right)(\bmod p) \\
\Leftrightarrow k s+\sum_{i=1}^{k} a_{i}=k t+\sum_{i=1}^{k} a_{i}(\bmod p) \\
\Leftrightarrow k s \equiv k t(\bmod p) \Leftrightarrow s=t \text { (contradiction). }
\end{array}
$$

Therefore, the non-empty proper subsets of $A_{1}$ are divided into $\frac{2^{p}-2}{p}$ groups, each containing $p$ sets, and the sums of all elements in these $p$ sets form a complete residue system modulo $p$. Thus, the number of subsets whose sum is divisible by $p$ is $\frac{2^{p}-2}{p}$, half of which contain 0.
Hence, the number of sets $B$ that satisfy the condition is $\frac{2^{p-1}-1}{p}$.