karalif commited on
Commit
ed8f354
·
verified ·
1 Parent(s): e42945f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -1,10 +1,14 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
  import re
4
- from keybert import KeyBERT
5
  import torch
 
6
 
7
- text_pipe = pipeline("text-classification", model="karalif/myTestModel", return_all_scores=True)
 
 
 
 
8
 
9
  def get_prediction(text):
10
  # Tokenize the input text
@@ -68,4 +72,4 @@ demo = gr.Interface(
68
  theme=gr.themes.Default(primary_hue="red", secondary_hue="pink")
69
  )
70
 
71
- demo.launch()
 
1
  import gradio as gr
 
2
  import re
3
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
4
  import torch
5
+ from keybert import KeyBERT
6
 
7
+ # Initialize your model and tokenizer here
8
+ # Replace 'your_model_path' and 'your_tokenizer_path' with the actual paths or model identifiers
9
+ model_identifier = "karalif/myTestModel"
10
+ new_model = AutoModelForSequenceClassification.from_pretrained(model_identifier)
11
+ new_tokenizer = AutoTokenizer.from_pretrained(model_identifier)
12
 
13
  def get_prediction(text):
14
  # Tokenize the input text
 
72
  theme=gr.themes.Default(primary_hue="red", secondary_hue="pink")
73
  )
74
 
75
+ demo.launch()