Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,9 +8,9 @@ from typing import List, Optional, Any
|
|
| 8 |
import argilla as rg
|
| 9 |
import os
|
| 10 |
|
| 11 |
-
def load_data():
|
| 12 |
-
ds = load_dataset("merve/turkish_instructions", split="train"
|
| 13 |
-
sample =
|
| 14 |
instruction = sample["talimat"]
|
| 15 |
input = sample["giriΕ"]
|
| 16 |
response = sample["Γ§Δ±ktΔ±"]
|
|
@@ -19,7 +19,6 @@ def load_data():
|
|
| 19 |
|
| 20 |
def create_record(instruction, input, response, feedback):
|
| 21 |
status = "Validated" if feedback == "DoΔru" else "Default"
|
| 22 |
-
#sample = next(iter(ds))
|
| 23 |
fields = {
|
| 24 |
"talimat": instruction,
|
| 25 |
"input": input,
|
|
@@ -65,7 +64,7 @@ class ArgillaLogger(FlaggingCallback):
|
|
| 65 |
gr.Interface(
|
| 66 |
load_data,
|
| 67 |
title = "ALPACA Veriseti DΓΌzeltme ArayΓΌzΓΌ",
|
| 68 |
-
description = "",
|
| 69 |
allow_flagging="manual",
|
| 70 |
flagging_callback=ArgillaLogger(
|
| 71 |
api_url="https://sandbox.argilla.io",
|
|
|
|
| 8 |
import argilla as rg
|
| 9 |
import os
|
| 10 |
|
| 11 |
+
def load_data(idx):
|
| 12 |
+
ds = load_dataset("merve/turkish_instructions", split="train").to_pandas()
|
| 13 |
+
sample = df.iloc[idx]
|
| 14 |
instruction = sample["talimat"]
|
| 15 |
input = sample["giriΕ"]
|
| 16 |
response = sample["Γ§Δ±ktΔ±"]
|
|
|
|
| 19 |
|
| 20 |
def create_record(instruction, input, response, feedback):
|
| 21 |
status = "Validated" if feedback == "DoΔru" else "Default"
|
|
|
|
| 22 |
fields = {
|
| 23 |
"talimat": instruction,
|
| 24 |
"input": input,
|
|
|
|
| 64 |
gr.Interface(
|
| 65 |
load_data,
|
| 66 |
title = "ALPACA Veriseti DΓΌzeltme ArayΓΌzΓΌ",
|
| 67 |
+
description = "Bir satΔ±r sayΔ±sΔ± verip ΓΆrnek alΔ±n.",
|
| 68 |
allow_flagging="manual",
|
| 69 |
flagging_callback=ArgillaLogger(
|
| 70 |
api_url="https://sandbox.argilla.io",
|