Spaces:
Sleeping
Sleeping
Petr Tsvetkov
commited on
Commit
·
baeb9f1
1
Parent(s):
0958c91
Add logging to the HF dataset
Browse files
app.py
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
|
|
| 1 |
import random
|
| 2 |
import uuid
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
from datasets import load_dataset
|
| 6 |
|
|
|
|
|
|
|
|
|
|
| 7 |
configuration = "commitchronicle-py-long" # select a configuration
|
| 8 |
dataset = load_dataset("JetBrains-Research/lca-cmg",
|
| 9 |
configuration,
|
|
@@ -11,7 +15,7 @@ dataset = load_dataset("JetBrains-Research/lca-cmg",
|
|
| 11 |
cache_dir="data")
|
| 12 |
n_samples = len(dataset)
|
| 13 |
|
| 14 |
-
saver = gr.
|
| 15 |
|
| 16 |
|
| 17 |
def get_github_link(repo, hash):
|
|
|
|
| 1 |
+
import os
|
| 2 |
import random
|
| 3 |
import uuid
|
| 4 |
|
| 5 |
import gradio as gr
|
| 6 |
from datasets import load_dataset
|
| 7 |
|
| 8 |
+
HF_TOKEN = os.environ.get('HF_TOKEN')
|
| 9 |
+
HF_DATASET = os.environ.get('HF_DATASET')
|
| 10 |
+
|
| 11 |
configuration = "commitchronicle-py-long" # select a configuration
|
| 12 |
dataset = load_dataset("JetBrains-Research/lca-cmg",
|
| 13 |
configuration,
|
|
|
|
| 15 |
cache_dir="data")
|
| 16 |
n_samples = len(dataset)
|
| 17 |
|
| 18 |
+
saver = gr.HuggingFaceDatasetSaver(HF_TOKEN, HF_DATASET)
|
| 19 |
|
| 20 |
|
| 21 |
def get_github_link(repo, hash):
|