merve HF staff commited on
Commit
2551a08
β€’
1 Parent(s): 856ea65

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -11,17 +11,19 @@ import os
11
  def load_data():
12
  ds = load_dataset("merve/turkish_instructions", split="train", streaming=True)
13
  sample = next(iter(ds))
 
 
 
 
14
 
15
- return sample
16
 
17
-
18
- def create_record(sample, feedback):
19
  status = "Validated" if feedback == "Doğru" else "Default"
20
  #sample = next(iter(ds))
21
  fields = {
22
- "talimat": sample["talimat"],
23
- "input": sample["giriş"],
24
- "response": sample["Γ§Δ±ktΔ±"]
25
  }
26
 
27
  # the label will come from the flag object in Gradio
@@ -61,6 +63,7 @@ class ArgillaLogger(FlaggingCallback):
61
 
62
 
63
  gr.Interface(
 
64
  title = "ALPACA Veriseti DΓΌzeltme ArayΓΌzΓΌ",
65
  description = "",
66
  allow_flagging="manual",
@@ -69,5 +72,6 @@ gr.Interface(
69
  api_key=os.getenv("TEAM_API_KEY"),
70
  dataset_name="alpaca-flags"
71
  ),
 
72
  flagging_options=["Doğru", "Yanlış", "Belirsiz"]
73
  ).launch()
 
11
  def load_data():
12
  ds = load_dataset("merve/turkish_instructions", split="train", streaming=True)
13
  sample = next(iter(ds))
14
+ instruction = sample["talimat"]
15
+ input = sample["giriş"]
16
+ response = sample["Γ§Δ±ktΔ±"]
17
+ return instruction, input, response
18
 
 
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,
26
+ "response": response
27
  }
28
 
29
  # the label will come from the flag object in Gradio
 
63
 
64
 
65
  gr.Interface(
66
+ load_data,
67
  title = "ALPACA Veriseti DΓΌzeltme ArayΓΌzΓΌ",
68
  description = "",
69
  allow_flagging="manual",
 
72
  api_key=os.getenv("TEAM_API_KEY"),
73
  dataset_name="alpaca-flags"
74
  ),
75
+ outputs=["text", "text", "text"]
76
  flagging_options=["Doğru", "Yanlış", "Belirsiz"]
77
  ).launch()