Spaces:
Runtime error
Runtime error
torileatherman
commited on
Commit
•
3832023
1
Parent(s):
7ab8162
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from datasets import load_dataset
|
3 |
import pandas as pd
|
|
|
4 |
|
5 |
dataset = load_dataset("torileatherman/sentiment_analysis_batch_predictions", split='train')
|
6 |
predictions_df = pd.DataFrame(dataset)
|
@@ -44,7 +45,11 @@ def thanks(sentiment):
|
|
44 |
labeled_sentiments = []
|
45 |
labeled_sentiments.append(sentiment)
|
46 |
counter = len(labeled_sentiments)
|
47 |
-
|
|
|
|
|
|
|
|
|
48 |
return f"""Thank you for making our model better!"""
|
49 |
|
50 |
|
|
|
1 |
import gradio as gr
|
2 |
from datasets import load_dataset
|
3 |
import pandas as pd
|
4 |
+
from huggingface_hub import create_repo
|
5 |
|
6 |
dataset = load_dataset("torileatherman/sentiment_analysis_batch_predictions", split='train')
|
7 |
predictions_df = pd.DataFrame(dataset)
|
|
|
45 |
labeled_sentiments = []
|
46 |
labeled_sentiments.append(sentiment)
|
47 |
counter = len(labeled_sentiments)
|
48 |
+
# create repo
|
49 |
+
create_repo("torileatherman/"+counter+"labeled_data")
|
50 |
+
# push to repo
|
51 |
+
labeled_sentiments = Dataset.from_pandas(labeled_sentiments)
|
52 |
+
labeled_sentiments.push_to_hub("torileatherman/"+counter+"labeled_data")
|
53 |
return f"""Thank you for making our model better!"""
|
54 |
|
55 |
|