MrAlexGov commited on
Commit
f562104
·
verified ·
1 Parent(s): 2eec2e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -18
app.py CHANGED
@@ -2,7 +2,6 @@ import gradio as gr
2
  from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
3
  import torch
4
 
5
- # Твоя модель
6
  model_name = "MrAlexGov/is-it-job-ru-q1a8e-lkjvk"
7
 
8
  # Загрузка
@@ -31,39 +30,33 @@ def predict(text):
31
  else:
32
  verdict = "❌ НЕ ПОДХОДИТ 😔"
33
 
34
- # Markdown-текст (красиво)
35
  return f"""
36
  # {verdict}
37
 
38
- **Класс:** `{label}`
39
- **Вероятность:** `{score:.1%}`
40
- **Модель:** BERT fine-tune (8900 вакансий)
41
- **Текст:** Обрезан до 512 слов (если длинный)
42
 
43
  ---
44
- *Тест: "Junior PHP dev" → подходит 95%*
45
  """
46
 
47
- # Gradio UI с БОЛЬШИМ ПОЛЕМ (Textbox 20 строк!)
48
  iface = gr.Interface(
49
  fn=predict,
50
  inputs=gr.Textbox(
51
  label="📝 Вставь текст вакансии",
52
- placeholder="Junior PHP developer MySQL Linux Python n8n ИИ VS Code удалёнка 100к",
53
  lines=8 # Ввод большой
54
  ),
55
  outputs=gr.Textbox( # ✅ ФИКС: Textbox с 20 строками (НЕ Markdown)
56
- lines=20, # Высокое!
57
- max_lines=30,
58
- show_label=False, # Без заголовка
59
  container=True
60
  ),
61
- title="🚀 Мой BERT-фильтр вакансий (дообучение fine-tune на 8900 примерах)",
62
- description="LABEL_1 = **подходит** (твои скиллы), LABEL_0 = нет. Точность ~90%!",
63
- examples=[
64
- ["Junior PHP developer MySQL Linux Python n8n ИИ VS Code удалёнка 100к"], # ✅
65
- ["Senior React JS Fullstack Node.js AWS Москва офис 300к"] # ❌
66
- ]
67
  )
68
  iface.launch(mcp_server=True)
69
 
 
2
  from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
3
  import torch
4
 
 
5
  model_name = "MrAlexGov/is-it-job-ru-q1a8e-lkjvk"
6
 
7
  # Загрузка
 
30
  else:
31
  verdict = "❌ НЕ ПОДХОДИТ 😔"
32
 
 
33
  return f"""
34
  # {verdict}
35
 
36
+ Класс: `{label}`
37
+ Вероятность: `{score:.1%}`
38
+ Модель: BERT fine-tune (8900 вакансий)
39
+ Текст: Обрезан до 512 слов (если длинный)
40
 
41
  ---
42
+ Тест: "Junior PHP dev" → подходит 95%
43
  """
44
 
45
+ # Gradio UI
46
  iface = gr.Interface(
47
  fn=predict,
48
  inputs=gr.Textbox(
49
  label="📝 Вставь текст вакансии",
50
+ placeholder="Например Junior PHP developer MySQL Linux Python n8n ИИ VS Code удалёнка 100к",
51
  lines=8 # Ввод большой
52
  ),
53
  outputs=gr.Textbox( # ✅ ФИКС: Textbox с 20 строками (НЕ Markdown)
54
+ lines=8,
55
+ label="Результат анализа моделью",
 
56
  container=True
57
  ),
58
+ title="🚀 Мой BERT-фильтр вакансий (дообучение fine-tune на 1000 примерах) + MCP",
59
+ description="LABEL_1 = подходит (твои скиллы), LABEL_0 = нет. Точность ~90%!",
 
 
 
 
60
  )
61
  iface.launch(mcp_server=True)
62