As noted in the comments, the transformation from the $(q_{i},\dot{q}_{i})$ coordinates to the $(q_{i},p_{i})$ coordinates is an example of a Legendre transform. Informally speaking, this allows you to use different coordinates to describe the system, while maintaining all information about the system.
In accordance with the general formulation of a Legendre transform, we use the equation
$p_{i} = \dfrac{\partial L}{\partial \dot{q}_{i}} \hspace{1em} (1)$
to implicitly define $\dot{q}_{i}$ in terms of $p_{i}$ and $q_{i}$. To see how this works in a simpler setting, we can define a variable $y$ as
$y = 2x +1$.
In this sense, we can view $y$ as a function of $x$. However, we can also invert this relation to solve for $x$ in terms of $y$, which gives
$x = \dfrac{1}{2}(y-1)$,
so here we view $x$ as a function of $y$. The point is that we have one independent variable and one dependent variable, but we are free to choose which is which. In classical mechanics the picture is slightly complicated by the fact that we now have 2 independent variables, but the principle remains the same: equation (1) can be viewed as either expressing $p_{i}$ in terms of $q_{i}$ and $\dot{q}_{i}$, or as expressing $\dot{q}_{i}$ in terms of $p_{i}$ and $q_{i}$, and we are free to choose the interpretation that suits our purposes.