Update app.py
Browse files
app.py
CHANGED
@@ -11,9 +11,8 @@ import requests
|
|
11 |
app = FastAPI()
|
12 |
|
13 |
# Cargar el modelo y el tokenizador
|
14 |
-
|
15 |
-
model = AutoModelForTokenClassification.from_pretrained(
|
16 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
17 |
|
18 |
class TextInput(BaseModel):
|
19 |
text: str
|
@@ -54,4 +53,4 @@ def predict_gradio(text):
|
|
54 |
return entities
|
55 |
|
56 |
demo = gr.Interface(fn=predict_gradio, inputs="text", outputs="json")
|
57 |
-
demo.launch(share=True)
|
|
|
11 |
app = FastAPI()
|
12 |
|
13 |
# Cargar el modelo y el tokenizador
|
14 |
+
tokenizer = AutoTokenizer.from_pretrained("mdarhri00/named-entity-recognition")
|
15 |
+
model = AutoModelForTokenClassification.from_pretrained("mdarhri00/named-entity-recognition")
|
|
|
16 |
|
17 |
class TextInput(BaseModel):
|
18 |
text: str
|
|
|
53 |
return entities
|
54 |
|
55 |
demo = gr.Interface(fn=predict_gradio, inputs="text", outputs="json")
|
56 |
+
demo.launch(share=True)
|