{"id":3834,"date":"2020-09-09T13:34:59","date_gmt":"2020-09-09T11:34:59","guid":{"rendered":"https:\/\/immune.institute\/?p=3834"},"modified":"2020-09-09T13:34:59","modified_gmt":"2020-09-09T11:34:59","slug":"empezando-tu-propio-portfolio-generando-texto-con-gpt2","status":"publish","type":"post","link":"https:\/\/immune.institute\/en\/blog\/empezando-tu-propio-portfolio-generando-texto-con-gpt2\/","title":{"rendered":"Empezando tu propio Portfolio &#8211; Generando texto con GPT2"},"content":{"rendered":"<p>Do you want everyone to try out that cool ML model you made to classify cats and dogs? Or do you want to be able to deploy your model to create your own portfolio? Whether you want one or the other, you might be interested in the webinar we held a few days ago with Alejandro D\u00edaz, Machine Learning Engineer currently working in Australia, where we learned about the importance of a portfolio in the programming world. We also developed and deployed an application to start creating our own portfolio.<\/p>\n<p>Along with this article you can watch the webinar by&nbsp;<a href=\"https:\/\/www.youtube.com\/watch?v=C_4-LGv7qXg\" target=\"_blank\" rel=\"noopener\">portfolio creation<\/a>&nbsp;and also&nbsp;<a href=\"https:\/\/docs.google.com\/presentation\/d\/16Ae_Pq-hkaAYA-UaFT0nny68xxp6n3VEdC4VsgpORqQ\/edit#slide=id.g8fd8e9b96c_0_63\" target=\"_blank\" rel=\"noopener\">access the presentation<\/a>.<\/p>\n\n\n\n<p>A portfolio is much more than a CV, in fact it is proof that you are capable of doing what you mention in your CV. It is also extremely differentiating when it comes to your next interview.<\/p>\n<p><b>\u00bfRealmente merece la pena?&#8230;Sin dudas!\u00a0<\/b>Although it is true that it requires time and patience and must be maintained over time, but the result is worth it.  As we said before, a portfolio that includes all your projects can make a difference in a job offer. It also allows you to create your own brand, your own identity.\u00a0<\/p>\n<p>You don't need to have 200 projects, contributions to open-source projects, to have worked for Bill Gate himself... None of that. You just need to review the projects you have worked on or tested (even the TensorFlow object-recognition tutorial), time and desire to be able to present them in a clear and elegant way in your new portfolio. And if you think you don't have any project, the mere fact of doing it is already one! ? But don't worry because we will develop an application for you to include it in your portfolio and learn how to display your ML models so that everyone can try them out!\u00a0<\/p>\n<p>In the webinar we saw how to implement an application to generate text using the famous model\u00a0<a href=\"https:\/\/huggingface.co\/jonasmue\/cover-letter-gpt2\" target=\"_blank\" rel=\"noopener\">GPT-2<\/a>. We use\u00a0<a href=\"https:\/\/flask.palletsprojects.com\/en\/1.1.x\/quickstart\/\" target=\"_blank\" rel=\"noopener\">flask<\/a>\u00a0to create our service and\u00a0<a href=\"https:\/\/www.docker.com\/\" target=\"_blank\" rel=\"noopener\">docker<\/a>\u00a0to encapsulate it, finally we deploy the service in\u00a0<b>Cloud Run<\/b>\u00a0(one of the Google Cloud serverless options). Here you can check the final result. ?<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-8238\" src=\"https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image5-1024x469-1.png\" alt=\"\" width=\"1024\" height=\"469\" srcset=\"https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image5-1024x469-1.png 1024w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image5-1024x469-1-256x117.png 256w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image5-1024x469-1-512x235.png 512w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image5-1024x469-1-768x352.png 768w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image5-1024x469-1-18x8.png 18w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>The first thing we did was to set up an account with\u00a0<a href=\"https:\/\/cloud.google.com\/\" target=\"_blank\" rel=\"noopener\">Google Cloud<\/a>in addition to downloading the\u00a0<a href=\"https:\/\/cloud.google.com\/sdk?hl=es\" target=\"_blank\" rel=\"noopener\">Google Cloud SDK<\/a>i.e. the command interface (cli). We simply follow the instructions in\u00a0<a href=\"https:\/\/cloud.google.com\/sdk\/docs\/quickstarts?hl=es\" target=\"_blank\" rel=\"noopener\">this tutorial<\/a>\u00a0in order to set up our account.<\/p>\n<h2><b>Why Google Cloud and not AWS or Azure?<\/b><\/h2>\n<p>Cloud Run allows us to deploy and expose our service without the need for another tool. We could have deployed it in\u00a0<b>AWS<\/b>but it's a bit \"complicated\" to deploy Docker images in functions.\u00a0<b>AWS Lambda<\/b>In addition, we would have needed to use\u00a0<b>API Gateway<\/b>\u00a0to expose the service. It is also a possibility to deploy it in\u00a0<b>AWS Fargate<\/b>but in that case we would have needed a container orchestrator.\u00a0<b>(ECS or EKS)\u00a0<\/b>and billing is per second. In the case of AWS Lambda and Cloud Run, billing is per 100 ms blocks, typically AWS Fargate is used in cases where the compute time is longer.<\/p>\n<p>In order to use Cloud Run we need to enable the API from the Google Cloud console, to do this we simply go to\u00a0<b>Cloud Run\u00a0<\/b>and create a service (you don't need to create the whole service, just click on \"<i>Create Service<\/i>\"The API is already activated).<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-8239\" src=\"https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/google-gpt2-1024x438-1.png\" alt=\"\" width=\"1024\" height=\"438\" srcset=\"https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/google-gpt2-1024x438-1.png 1024w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/google-gpt2-1024x438-1-256x110.png 256w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/google-gpt2-1024x438-1-512x219.png 512w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/google-gpt2-1024x438-1-768x329.png 768w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/google-gpt2-1024x438-1-18x8.png 18w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Now we can start to develop our code, for this we have created a\u00a0<a href=\"https:\/\/github.com\/alejandrods\/text-generation-gpt2\/tree\/template\" target=\"_blank\" rel=\"noopener\">template<\/a>\u00a0that we completed in the webinar, in case you want to have the complete code you can download the\u00a0<a href=\"https:\/\/github.com\/alejandrods\/text-generation-gpt2\" target=\"_blank\" rel=\"noopener\">master branch<\/a>\u00a0and follow the instructions to execute it, but we advise you to watch the video of the webinar?<\/p>\n<h3><strong>The moment of truth<\/strong><b><\/b><\/h3>\n<p>Once we have the code finished and tested in our local, we can push our Docker image to Google Cloud. To do this, simply run the following lines in a terminal:<\/p>\n\n\n<pre class=\"wp-block-code\"><code>docker tag text-generator-gpt2:latest eu.gcr.io\/text-generator-gpt-2\/text-generator-gpt2:latest\n\ndocker push eu.gcr.io\/text-generator-gpt-2\/text-generator-gpt2:latest<\/code><\/pre>\n\n\n<p>It usually takes a few minutes, but when the process is finished we can go to Cloud Run, remember that it is important to check \"Allow unauthenticated invocations\" for our service to work.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-8240\" src=\"https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image1-854x1024-1.png\" alt=\"\" width=\"854\" height=\"1024\" srcset=\"https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image1-854x1024-1.png 854w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image1-854x1024-1-214x256.png 214w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image1-854x1024-1-427x512.png 427w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image1-854x1024-1-768x921.png 768w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image1-854x1024-1-10x12.png 10w\" sizes=\"(max-width: 854px) 100vw, 854px\" \/><\/p>\n<p>If all has gone well, the service will have been deployed correctly and you will now have&nbsp;<b>you will have the first project that you can include in your own portfolio! ?<\/b><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-8242\" src=\"https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image2-1024x502-1.png\" alt=\"\" width=\"1024\" height=\"502\" srcset=\"https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image2-1024x502-1.png 1024w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image2-1024x502-1-256x126.png 256w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image2-1024x502-1-512x251.png 512w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image2-1024x502-1-768x377.png 768w, https:\/\/immune.institute\/wp-content\/uploads\/2020\/09\/image2-1024x502-1-18x9.png 18w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>IMMUNE Technology Institute, with the collaboration of Spanish Startups, has prepared a Datathon on&nbsp;<b>19 September<\/b>&nbsp;where you can learn and attend talks very similar to this one with the best experts in Data Science.<br \/>In addition, we have organised several&nbsp;<b>masterclass<\/b>&nbsp;y&nbsp;<b>Data Science Challenges<\/b>&nbsp;where you can put your knowledge to the test and best of all, you'll be able to&nbsp;<b>they will have a prize!!!<\/b><\/p>\n<p><a href=\"https:\/\/bit.ly\/3jcLzFY\" target=\"_blank\" rel=\"noopener\"><b>Sign up here!<\/b><\/a><\/p>\n<h3><b>Wait, one last thing<\/b><\/h3>\n<p>Keep it going! Due to the demand for information about our&nbsp;<b>Master Data Science,<\/b>&nbsp;we have organised an information session on&nbsp;<b>24 September<\/b>&nbsp;with M\u00f3nica Villas, director of the programme, to answer any questions.<\/p>\n<p>IMMUNE can help you to boost your career through its partner companies and contacts with recruiters and professionals in the sector, do not hesitate to sign up if you want more information about our programmes.<b>.<\/b><\/p>\n<p><a href=\"https:\/\/bit.ly\/3jbWqjd\" target=\"_blank\" rel=\"noopener\"><b>Sign up here!<\/b><\/a><\/p>\n<div id=\"text_block-56-356\" class=\"ct-text-block\">\n<div>\n<p><em>This article was written by:&nbsp;<a href=\"https:\/\/medium.com\/u\/3b43171da13b\" target=\"_blank\" rel=\"noopener\">Alejandro Diaz Santos<\/a>- (<a href=\"https:\/\/www.linkedin.com\/in\/alejandro-diaz-santos-8aab812a\/\" target=\"_blank\" rel=\"noopener\">LinkedIn<\/a>,&nbsp;<a href=\"https:\/\/github.com\/alejandrods\" target=\"_blank\" rel=\"noopener\">GitHub<\/a>)<\/em><\/p>\n<\/div>\n<\/div>\n<div id=\"div_block-234-356\" class=\"ct-div-block\">&nbsp;<\/div>","protected":false},"excerpt":{"rendered":"<p>\u00bfQuieres que todo el mundo pruebe ese modelo de ML tan guay que has hecho para clasificar perros y gatos? \u00bfO quieres poder desplegar tu modelo para crear tu propio portfolio? Tanto si quieres una cosa u otra, seguro que te interesa el webinar que celebramos hace unos d\u00edas con Alejandro D\u00edaz, Machine Learning Engineer [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":8238,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-3834","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/posts\/3834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/comments?post=3834"}],"version-history":[{"count":0,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/posts\/3834\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/media\/8238"}],"wp:attachment":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/media?parent=3834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/categories?post=3834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/tags?post=3834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}