juanpablosanchez commited on
Commit
2470a98
·
verified ·
1 Parent(s): 277491c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -11,9 +11,8 @@ import requests
11
  app = FastAPI()
12
 
13
  # Cargar el modelo y el tokenizador
14
- model_name = "mdarhri00/named-entity-recognition"
15
- model = AutoModelForTokenClassification.from_pretrained(model_name)
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)