Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import gradio as gr
|
3 |
+
import plotly.express as px
|
4 |
+
import numpy as np
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
def get_plot(period=1):
|
9 |
+
run = api.run("fengshenbang/llama2_13b_cpt_v1/kakfv1ab")
|
10 |
+
metrics_dataframe = run.history()
|
11 |
+
y = metrics_dataframe['train/lm_loss'].tolist()
|
12 |
+
x = np.arange(0, len(y), 1)
|
13 |
+
y = np.array(y)
|
14 |
+
fig = px.line(x=x, y=y)
|
15 |
+
return fig
|
16 |
+
|
17 |
+
|
18 |
+
with gr.Blocks() as demo:
|
19 |
+
with gr.Row():
|
20 |
+
with gr.Column():
|
21 |
+
gr.Markdown("Ziya-LLaMA2-CPT/train/lm_loss")
|
22 |
+
plot = gr.Plot(label="Plot (updates every half second)")
|
23 |
+
|
24 |
+
dep = demo.load(get_plot, None, plot, every=1, live=False)
|
25 |
+
|
26 |
+
|
27 |
+
if __name__ == "__main__":
|
28 |
+
demo.queue().launch(share=True)
|