gokceuludogan commited on
Commit
e6fc8aa
·
verified ·
1 Parent(s): 1bcb9c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -3,6 +3,10 @@ import gradio as gr
3
  import spaces
4
  from transformers import pipeline
5
  import torch
 
 
 
 
6
 
7
  binary_example = [["Yahudi terörüne karşı protestolar kararlılıkla devam ediyor."]]
8
  category_example = [["Ermeni zulmü sırasında hayatını kaybeden kadınlar anısına dikilen anıt ziyarete açıldı."]]
@@ -16,15 +20,15 @@ CITATION = """"
16
  """
17
 
18
  def binary_classification(input):
19
- model = pipeline(model='gokceuludogan/berturk_tr_hate_print_w0.1')
20
  return model(input)[0]
21
 
22
  def category_classification():
23
- model = pipeline(model='gokceuludogan/berturk/tr_hateprint_cat_w0.1_b128')
24
  return model(input)[0]
25
 
26
  def target_detection():
27
- model = pipeline(model='gokceuludogan/turna_generation_tr_hateprint_target')
28
  return model(input)[0]
29
 
30
  with gr.Blocks(theme="abidlabs/Lime") as demo:
 
3
  import spaces
4
  from transformers import pipeline
5
  import torch
6
+ ımport os
7
+
8
+
9
+ token = os.getenv('HF_AUTH_TOKEN')
10
 
11
  binary_example = [["Yahudi terörüne karşı protestolar kararlılıkla devam ediyor."]]
12
  category_example = [["Ermeni zulmü sırasında hayatını kaybeden kadınlar anısına dikilen anıt ziyarete açıldı."]]
 
20
  """
21
 
22
  def binary_classification(input):
23
+ model = pipeline(model='gokceuludogan/berturk_tr_hate_print_w0.1', token=token)
24
  return model(input)[0]
25
 
26
  def category_classification():
27
+ model = pipeline(model='gokceuludogan/berturk/tr_hateprint_cat_w0.1_b128', token=token)
28
  return model(input)[0]
29
 
30
  def target_detection():
31
+ model = pipeline(model='gokceuludogan/turna_generation_tr_hateprint_target', token=token)
32
  return model(input)[0]
33
 
34
  with gr.Blocks(theme="abidlabs/Lime") as demo: