freddyaboulton HF Staff commited on
Commit
bad42fb
·
verified ·
1 Parent(s): 5220cc4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -6
app.py CHANGED
@@ -3,13 +3,33 @@ import gradio as gr
3
  with gr.Blocks() as demo:
4
  gr.Markdown(
5
  value="""
6
- ### Python code
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  ```python
8
- def hello_world():
9
- print("Hello, world!")
10
  ```
11
 
12
- A link to the gradio docs is [here](https://gradio.app)
13
- """)
 
 
 
 
14
 
15
- demo.launch()
 
3
  with gr.Blocks() as demo:
4
  gr.Markdown(
5
  value="""
6
+ ## Start logging with Trackio 🤗
7
+
8
+ To start logging to this Trackio dashboard, first make sure you have the Trackio library installed. You can do this by running:
9
+
10
+ ```bash
11
+ pip install trackio
12
+ ```
13
+
14
+ Then, start logging to this Trackio dashboard by passing in the `space_id` to `trackio.init()`:
15
+
16
+ ```python
17
+ import trackio
18
+ trackio.init(project="my-project", space_id="{}")
19
+ ```
20
+
21
+ Then call `trackio.log()` to log metrics.
22
+
23
  ```python
24
+ for i in range(10):
25
+ trackio.log({{"loss": 1/(i+1)}})
26
  ```
27
 
28
+ Finally, call `trackio.finish()` to finish the run.
29
+
30
+ ```python
31
+ trackio.finish()
32
+ ```
33
+ """ )
34
 
35
+ demo.launch()