Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,14 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from transformers import pipeline
|
| 3 |
import re
|
| 4 |
-
from
|
| 5 |
import torch
|
|
|
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|