Perhaps not the most elegant approach, but the complete snippet below will produce the following figure. Some central parts of the snippets are:
Approach:
for i, d in enumerate(fig.data):
for j, a in enumerate(d.x):
fig.add_annotation(x=a, y = d.y[j], text = str(d.y[j])[:5],
showarrow = False,
yshift = 10,
font=dict(color=d.line.color, size=12))
Plot 1:

If you'd like to follow other color cycles for your annotations, just include:
colors = px.colors.qualitative.Alphabet
And replace:
font=dict(color=d.line.color, size=12)
with:
font=dict(color=colors[i], size=12)
And get:
Plot 2:

I'd be happy to go into all the details if this is something you could use.
Complete code:
# imports
import pandas as pd
import plotly.express as px
# data
df = px.data.stocks().tail(10)
df = df.drop(['AMZN', 'AAPL'], axis = 1)
df.set_index('date', inplace = True)
colors = px.colors.qualitative.Alphabet
fig = px.line(df, x = df.index, y = df.columns)
for i, d in enumerate(fig.data):
for j, a in enumerate(d.x):
fig.add_annotation(x=a, y = d.y[j], text = str(d.y[j])[:5],
showarrow = False,
yshift = 10,
font=dict(color=d.line.color, size=12)
# font=dict(color=colors[i], size=12)
)
fig.show()