Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

116
Vistas
Encoding sentences with Setenece BERT's model in FastAPI changes the result from the results with Jupyter and python scripts

System

  • macbook pro
  • OSX 10.15.5(Catalina)
  • Docker version 19.03.12, build 48a66213fe

Library

  • uvicorn==0.11.8
  • fastapi==0.61.0
  • torch==1.6.0
  • transformers==3.0.2
  • sentence-transformers==0.3.2
  • scikit-learn==0.20.0
  • scipy==1.4.1
  • pandas==0.23.4
  • jupyter==1.0.0

Detail

I used Colaboratory to fine-tune Setence BERT and save that model. Then I went local and built an environment with Docker that included jupyter and FastAPI, and in that environment I was able to confirm that the model I saved with Jupyter, launched in Docker, returned the same estimation results as in the Collaboratory. When I used that model, I got different results when I used FastAPI started in the same Docker environment as Jupyter. All the text entered in this flow is the same.

The analysis showed that the SentenceTransformer loaded the model and then encoded it, and found that it calculated completely different embedding.

Thanks to your advice.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

sorry, I use Japanese model but I forgat translate default BertTokenizer to BertJapaneseTokenizer.

Change default Tokenizer fixed this problem.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda