SML-Argilla / app.py
ravi259's picture
new datasets
3198832
raw
history blame contribute delete
862 Bytes
import gradio as gr
import argilla as rg
import os
from datasets import load_dataset
dataset = load_dataset("dvilasuero/banking_app", split="train").shuffle()
# You can find your Space URL behind the Embed this space button
# Change it
rg.init(
api_url="https://ravi259-sml-argilla.hf.space",
api_key="admin.apikey"
)
banking_ds = load_dataset("argilla/banking_sentiment_setfit", split="train")
# Argilla expects labels in the annotation column
# We include labels for demo purposes
banking_ds = banking_ds.rename_column("label", "annotation")
# Build argilla dataset from datasets
argilla_ds = rg.read_datasets(banking_ds, task="TextClassification")
# Create dataset
rg.log(argilla_ds, "bankingapp_sentiment")
def greet(name):
return "Hello " + name + "!!"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch(share=True)