MrAlexGov commited on
Commit
c339282
·
verified ·
1 Parent(s): 7138121

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +14 -0
  2. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ model_name = "MrAlexGov/autotrain-q1a8e-lkjvk" # Твоя
5
+
6
+ classifier = pipeline("text-classification", model=model_name)
7
+
8
+ def predict(text):
9
+ result = classifier(text)[0]
10
+ label = "✅ Подходит тебе!" if "1" in result['label'] else "❌ Не подходит"
11
+ return f"{label}\nВероятность: {result['score']:.2%}\nКласс: {result['label']}"
12
+
13
+ iface = gr.Interface(fn=predict, inputs=gr.Textbox(label="Вставь вакансию"), outputs="text", title="Мой BERT-фильтр вакансий")
14
+ iface.launch()
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ transformers
2
+ torch
3
+ gradio
4
+ accelerate