Gulzd commited on
Commit
e4cde66
·
1 Parent(s): 2735196

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -13
app.py CHANGED
@@ -59,19 +59,16 @@ def result_predict(num):
59
  elif num == 2:
60
  return 'SEXIST'
61
 
62
- def gradio_comment(comment):
63
- text_to_predict = ["hayvan gibi iş yapma öküz"]
64
- results = predict(text_to_predict)
65
 
66
- for text, result in zip(text_to_predict, results):
67
- print(f"Metin: {text}\nTahmin: {result}\n")
68
 
 
 
 
 
 
 
 
 
 
69
 
70
- GradioGUI = gr.Interface(
71
- fn=gradio_comment,
72
- inputs='text',
73
- outputs='text',
74
- title='Aşağılayıcı Yorum Tespiti',
75
- css='''span{text-transform: uppercase} p{text-align: center}''')
76
-
77
- GradioGUI.launch()
 
59
  elif num == 2:
60
  return 'SEXIST'
61
 
 
 
 
62
 
 
 
63
 
64
+ # Gradio Interface oluşturun
65
+ iface = gr.Interface(
66
+ fn=predict,
67
+ inputs="text",
68
+ outputs=["text", "text"],
69
+ live=True,
70
+ layout="horizontal",
71
+ title="BERT Text Classification"
72
+ )
73
 
74
+ iface.launch()