  Let $F$ be a totally real field, $\mathfrak{p}$ an unramified place of $F$
dividing $p$ and $\overline{r}:
\mathrm{Gal}(\overline{F}/F)\rightarrow\mathrm{GL}_2(\overline{\mathbb{F}}_p)$
a continuous irreducible modular representation. The work of Buzzard, Diamond
and Jarvis associates to $\overline{r}$ an admissible smooth representation of
$\mathrm{GL}_2(F_\mathfrak{p})$ on the mod $p$ cohomology of Shimura curves
attached to indefinite division algebras which split at $\mathfrak{p}$. When
$\overline{r}|_{\mathrm{Gal}(\overline{F_\mathfrak{p}}/F_\mathfrak{p})}$ is
tamely ramified and generic (and under some technical assumptions), we
determine the subspace of invariants of this representation under the principal
congruence subgroup of level $\mathfrak{p}$. In particular, it depends only on
$\overline{r}|_{\mathrm{Gal}(\overline{F_\mathfrak{p}}/F_\mathfrak{p})}$ and
verifies a multiplicity one property.
